iOS 8 [Uiapplication Sharedapplication].Scheduledlocalnotifications Empty

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



Leave a reply



Submit