开发者

How to unregister / cancel UILocalNotification

开发者 https://www.devze.com 2023-04-10 10:50 出处:网络
I have some trouble finding this. Actually I want to unregister / cancel all of my local notification when I kill my appln from background. Any thoughts how c开发者_如何学Goan I do that.Just do this t

I have some trouble finding this. Actually I want to unregister / cancel all of my local notification when I kill my appln from background. Any thoughts how c开发者_如何学Goan I do that.


Just do this to cancel all local notifications.

[[UIApplication sharedApplication] cancelAllLocalNotifications];

And, of course, you can't do this when the app is killed from multi-tasking bar, since your app will not be notified by any means when it is killed from multi-tasking bar.


When your app is killed while in the background you do NOT get any notification and you do NOT get any chance to run or cleanup. You must do this when you go into the background or wait until your app comes back to the foreground.

When an app is killed from the task bar while in the background it is sent a SIGKILL signal which cannot be caught by a signal handler, it is just summarily killed with no warning to the app.

0

精彩评论

暂无评论...
验证码 换一张
取 消