I'm trying to schedule several UILocalNotification
s, and I need to have access to the already created notifications.
Is it possible to have a list/array of all the UILocalNotification
s created? Can I edit the fire date of an existing local notification?
This is the code I use for creating local notifications:
UILocalNotification* localNotification = [[UILocalNotification alloc] init];
localNotification.fireDate = pickerDate;
localNotification.alertBody = textFieldName.text;
localNotification.alertAction = @"Item date expired!";
localNotification.timeZone = [NSTimeZone defaultTimeZone];
localNotification.applicationIconBadgeNumber = [[UIApplication sharedApplication] applicationIconBadgeNumber] + 1;
you can get all UILocalNotifications
with below code
UIApplication* objApp = [UIApplication sharedApplication];
NSArray* oldNotifications = [objApp scheduledLocalNotifications];
and also you can cancel that Notification with bellow code..
if ([oldNotifications count] > 0)
[objApp cancelAllLocalNotifications];
Also see one basic demo with tutorial for UILocalNotification
from below link
iphone-programming-tutorial-local-notifications
to retrieve current notifications
NSArray *currentNotifications = [[UIApplication sharedApplication] scheduledLocalNotifications];
edit the content of this array (you might have to create a mutable copy first) and then set it back using
[[UIApplication sharedApplication] setScheduledLocalNotifications:myNotifications];
myNotifications containing both the old pending notifications and your new ones, it will override the old values, so by editing the fireDate of the UILocalNotification objects in this array you can change the date they will be fired at.
I think you want this.
[[UIApplication sharedApplication] scheduledLocalNotifications]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With