Ios 知道应用程序IDBecomeActive时UINotification是否已关闭
我想知道当用户不是通过触摸通知本身而是通过快速切换应用程序或主屏幕图标启动应用程序时,UINotification何时关闭Ios 知道应用程序IDBecomeActive时UINotification是否已关闭,ios,objective-c,notifications,uilocalnotification,Ios,Objective C,Notifications,Uilocalnotification,我想知道当用户不是通过触摸通知本身而是通过快速切换应用程序或主屏幕图标启动应用程序时,UINotification何时关闭 我已检查了[[UIApplication sharedApplication]scheduledLocalNotifications],但在通知触发后,此数组为空。一旦触发localnotification并将在通知中心显示,它将不会在[[UIApplication sharedApplication]scheduledLocalNotifications]中显示它。 如果
我已检查了
[[UIApplication sharedApplication]scheduledLocalNotifications]
,但在通知触发后,此数组为空。一旦触发localnotification并将在通知中心显示,它将不会在[[UIApplication sharedApplication]scheduledLocalNotifications]中显示它。
如果您的应用处于活动状态,将调用didreceivelocalnotification
,但当您的应用未处于活动状态时,它将显示在通知中心
因此,它将保留在通知中心,直到您清除它
如果您想获取,可以在appdelegate方法中使用didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
方法检查它
UILocalNotification *localNotif = [launchOptions objectForKey:UIApplicationLaunchOptionsLocalNotificationKey];
if (localNotif)
{
NSLog(@"lcoal:%@",[localNotif userInfo]);
UIAlertView *al=[[UIAlertView alloc]initWithTitle:@"Challenge gehaald!" message:@"Gefeliciteerd, je hebt deze bonus challenge succesvol afgerond." delegate:nil cancelButtonTitle:@"ok" otherButtonTitles:nil];
[al show];
}