我需要通过cancelLocalNotification:
除去的同一个后呈现UILocalNotification
。问题是删除执行速度慢于开始新的执行并删除刚添加的通知。如何完成UILocalNotification cancelLocalNotification之后执行方法:在IOS 8或9
我怎么能确定UILocalNotification cancelLocalNotification:
完成?
我需要通过cancelLocalNotification:
除去的同一个后呈现UILocalNotification
。问题是删除执行速度慢于开始新的执行并删除刚添加的通知。如何完成UILocalNotification cancelLocalNotification之后执行方法:在IOS 8或9
我怎么能确定UILocalNotification cancelLocalNotification:
完成?
如果您想要在特定的定时器间隔内致电通知或在第一个结束后致电通知,那么它本身具有的本地通知repeatInterval
属性和值应为NSCalendarUnit
。并用特定的定时器重复。
否则第二个选项是下面的委托方法始终调用
-(void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification{
// I recieved a notification
}
当块的GET通知
,你可以删除所有本地通知,并创建火日新应该是
localNotification.fireDate = [NSDate date];
尝试检查,
[[UIApplicatio ÑsharedApplication] scheduledLocalNotifications]
这将返回计划通知的阵列。
您可以检查数组或数组的NSLog计数,如果本地通知被取消或无法获取详细信息。
您可以调用UILocalNotification cancelLocalNotification:
后等待一点点,新UILocalNotification
像这样的事情
[[UIApplication sharedApplication] cancelLocalNotification:someNotification];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
/* register UILocalNotification again here after delay */
})重新注册;
已经显示通知。 scheduledLocalNotifications在等待列表中返回通知。这不是我的情况。 –