I am currently scheduling local notifications to appear once per day at 6PM if a user has not already opened the app that day. If the user has already loaded the application, th
localNotification.fireDate = fireIn;
in this line check wheather "fireIn" is object of NSDate
or NSString
.
If it's NSString
convert it into NSDate
object with help of NSDateformatter
and then assing it to localNotification
fireDate.
I was facing same problem previously and resolved it with above mentioned steps.
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.
if the schedule has invalid fire date, it will not get scheduled and result empty array returned, because there never has a valid one schedule, try to print out your localNotification like below, you may find out the problem.
NSLog(@"Notification--->: %@", localNotification);