I am sending out local notifications within my app; if the user responds to the notification the app calls the delegate method below and I can handle it:
- (void)application:(UIApplication *)app didReceiveLocalNotification:(UILocalNotification *)notif
If the user doesn’t respond to the notification but opens the app after, I would like to handle it the same way I would if they responded to the notification.
I also checked if the app is launching with launch options but this only seems to be called if they respond directly to the notification.
What is the best way to check that a notification has been fired but the user has responded of their own accord?
You’ll have to keep track of which notifications you’ve scheduled yourself. You can use UIApplication’s
scheduledLocalNotificationsto see which ones are still scheduled; if you compare that list to the list of notification you know you’ve scheduled, you can see which ones have been fired.