I have an iOS 8.0 application that produces some local notifications which are shown in the global Notifications pull down (The Notifications view
).
Perfect! Now I would like to:
- get all listed notifications for my app.
- delete a specific notification based on the
userInfo
I have provided when producing the local notification.
I have been looking around https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/WhatAreRemoteNotif.html#//apple_ref/doc/uid/TP40008194-CH102-SW1
And exploring the properties and methods for UIApplication
:
UIApplication.sharedApplication().scheduledLocalNotifications.count
~ but that one is empty which makes sense because the notifications in the list have been fired and are no longer scheduled... so:
Which api(s) can I use for that ?
Update 1
Most recent explanation for scheduledLocalNotifications beining empty iOS 8 [UIApplication sharedApplication].scheduledLocalNotifications empty
Which lead me to a rather awkward solution storing notification in NSUserdefault by key and then later get it by key and canceling the usual way:
UIApplication.sharedApplication(<notification get from userdefaults by key>).
BUT I really liked to get hold of a more clean iOS solution.