Ios 删除应用程序时是否可以取消所有通知?
我正在处理一个提醒到期日的申请。我使用重复间隔(Ios 删除应用程序时是否可以取消所有通知?,ios,cocoa-touch,notifications,uilocalnotification,Ios,Cocoa Touch,Notifications,Uilocalnotification,我正在处理一个提醒到期日的申请。我使用重复间隔(NSMonthCalendarUnit,NSDayCalendarUnit,NSDayCalendarUnit,NSDayCalendarUnit)的UILocanTification实现了相同的功能 比如说。我已于2012年10月3日发出本地通知 如果我从iPad/iPhone上删除应用程序。再次重新安装应用程序时,我仍然会收到重新安装前设置的旧通知。删除应用程序时是否可以cancelallNotification 我猜你可以在安装应用程序后进行
NSMonthCalendarUnit
,NSDayCalendarUnit
,NSDayCalendarUnit
,NSDayCalendarUnit
)的UILocanTification实现了相同的功能
比如说。我已于2012年10月3日发出本地通知
如果我从iPad/iPhone上删除应用程序。再次重新安装应用程序时,我仍然会收到重新安装前设置的旧通知。删除应用程序时是否可以
cancelallNotification
我猜你可以在安装应用程序后进行一次性检查并运行以下程序:
- (void)cancelAllLocalNotifications
i、 e
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
if([defaults objectForKey:@"FIRST-TIME-CHECK"] == null){
[[UIApplication sharedApplication] cancelAllLocalNotifications];
[defaults setValue:@"WHATEVER" forKey:@"FIRST-TIME-CHECK"];
}