我正在使用 UILocalNotification。当通知显示并且用户单击我的 alertAction 时,如何在我的应用加载时将它们定向到特定视图?(类似于日历应用程序如何向您显示刚刚收到警报的事件)。
我在用:
- (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;
}