UILocalNotification shows view after notification?

I am using UILocalNotification. When a notification is displayed and the user clicks on my alertAction, how can I direct them to a specific view when my application loads? (Similar to how the calendar application shows you an event that has just been warned).

I use:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOption {

    UILocalNotification *localNotif = [launchOptions objectForKey:UIApplicationLaunchOptionsLocalNotificationKey]; 

    if (localNotif) {
        NSString *itemName = [localNotif.userInfo objectForKey:ItemListKey]; 
        //  [viewController displayItem:itemName]; // custom method 
        application.applicationIconBadgeNumber = localNotif.applicationIconBadgeNumber-1; 
        NSLog(@"has localNotif %@",itemName);
    }

    return YES;
}
+3
source share
1 answer

, applicationLaunch. , , - . , ..

: , :

  • ( , "" )

+3

Source: https://habr.com/ru/post/1792614/


All Articles