I have a problem with my UILocalNotification.
I am scheduling the notification with my method.
- (void) sendNewNoteLocalReminder:(NSDate *)date a
My solution is to remove all scheduled Notifications on these methods.
-applicationDidFinishLaunchingWithOptions:
- (void)applicationDidBecomeActive:(UIApplication *)application;
- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification;
with
[[UIApplication sharedApplication] cancelAllLocalNotifications];
You can still get to the LocalNotification object that activated your app by using.
UILocalNotification *localNotif = [launchOptions objectForKey: UIApplicationLaunchOptionsLocalNotificationKey];
Then I reschedule new Notifications on
- (void)applicationDidEnterBackground:(UIApplication *)application;
This avoids to have bookkeeping for all the notifications. I send some context information in the userInfo dictionary as well. This then helps to jump to the right place in the app.