Cannot schedule nor cancel local notifications from within extensions

Originator:alex.truppel
Number:rdar://18846181 Date Originated:01-Nov-2014 01:46 PM
Status:Duplicate Resolved:
Product:iOS SDK Product Version:
Classification: Reproducible:Yes
 
Summary:
Scheduling of local notifications is done with this line of code:

UIApplication.sharedApplication().scheduleLocalNotification(notification)

Since UIApplication.sharedApplication() is not available from an app extension, it is impossible to schedule local notifications (it is also impossible to cancel scheduled notifications).

It is always possible to do so by launching the main app using an url scheme and then having the main app schedule/cancel the notification. However it is most defenitely not user-friendly to yank the user out of the app they're in just to shedule/cancel a notification on the main app and then have the main app just sit there without doing anything.

There are many uses for scheduling notifications from within extensions, specially from within Today Extensions. However, it is impossible to do so right now (as far as I can tell). Here are some examples of why this is useful:

 - A list of upcoming movies is displayed on a today extension and the user taps on one of the movies to schedule a notification to alert him that the movie is now available in theaters

 - A reminders app shows a list of reminders and users can toggle whether a reminder should present a notification or not (this involves both scheduling and canceling notifications)

 - A to-do app shows a list of tasks and allows for to-dos to be completed by tapping on them. A to-do can have scheduled notifications associated with it and when a to-do is completed those notifications should be cancelled (imagine having to switch to the main app just to cancel the notification...).

Please consider adding this feature. It would make extensions even more powerful for developers and users alike.

Steps to Reproduce:
N/A

Expected Results:
N/A

Actual Results:
N/A

Version:
N/A

Notes:
N/A

Configuration:
N/A

Attachments:

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!