The user has several options: # 1) They want to see a notification for your application. # 2) If notifications are enabled for your application, do you want them to click your notification to launch the application. If they accept notifications and open your notification when your application is in the background, application:didReceiveLocalNotification . To be clear, the user must accept the notification (for example, move the slider under the notification) ... otherwise, NOTHING is called.
- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification { NSLog(@"%@", notification); }
If your application has completed application:didFinishLaunchingWithOptions: is called -
- (BOOL)application:(UIApplication *) application didFinishLaunchingWithOptions: (NSDictionary *)launchOptions { UILocalNotification *theNotification = [launchOptions objectForKey:UIApplicationLaunchOptionsLocalNotificationKey]; NSLog(@"%@", theNotification); return YES; }
source share