iOS 8 [UIApplication sharedApplication].scheduledLocalNotifications empty
This is not iOS 8 issue, but
[UIApplication sharedApplication].scheduledLocalNotifications
issue. Most relevant answer which i found here
Having similar issues right now. My guess here is that iOS does not
schedule the notifications immediately but only at the end of the
current run loop. I am running into these problems when setting the
scheduledLocalNotifications property several times in the same run
loop and changes don't seem to be updated accordingly. I think I will
just keep a copy of the local notifications array myself and only set
scheduledLocalNotifications and never read it.
UIApplication.sharedApplication.scheduledLocalNotifications is always empty
Seems I have not been first to be stucked on it..
But seems answer is much closer than I tought.
Cmd + LPM
public var scheduledLocalNotifications: [UILocalNotification]? // setter added in iOS 4.2
The property is just form of setter. And probably was never intended to get scheduled notifications
How to get the local notifications which are listed in Notifications pull down?
Not at all. There is no api to get that. sorry
-- you can see notifications that are pending (not yet delivered to the user) only
How to check current set local notification?
It has a callback return so try it like this and you should get your array of Scheduled Local Notifications
PushNotification.getScheduledLocalNotifications((data) => {
console.log('ScheduledLocalNotifications: ', data);
});
iOS UILocalNotification scheduled, but not fired
I made a mistake by not adding an unique ID to the notification (notification.userInfo was not always unique), and overwrites the previous scheduled notification. Thats why it something does work and sometimes doesn't.
Fixed the problem by making it unique.
Thanks
iOS/Objective-C: Is there any way to see what localNotifications are scheduled?
Yes you can:
[[UIApplication sharedApplication] scheduledLocalNotifications]
will return an array of existing notification instances.
Related Topics
What Exactly Does ': Class' Do in a Protocol Declaration
Cancel All Operations + Afnetworking 3.0
Swift Package Manager Issues with Unversioned Packages (Example: Firebase-Ios-Sdk)
Swift + Firebase Security Not Working
Uicollectionview - Horizontal Paging with One Cell at a Time
How to Set Size Leftbarbuttonitem
Indexpathforrowatpoint Returns Nil Only for First Cell in a UItableview
Should I Use Realm Objective-C or Realm Swift in My Mixed Objective-C/Swift Project
iOS Add Button to Widget Extension
Initialization of 'Unsafepointer<Int>' Results in a Dangling Pointer
Spritekit Swift Node Count Issues
Swift - Add Same Navigation Bar Items to Every Page
CSS Flexible Box Layout on Ipad