如何注销/取消 UILocalNotification
我很难找到这个。实际上,当我从后台杀死我的应用程序时,我想取消注册/取消所有本地通知。有什么想法我该怎么做。
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 can I do that.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
只需执行此操作即可取消所有本地通知。
当然,当应用程序从多任务栏终止时,您不能执行此操作,因为当您的应用程序从多任务栏终止时,不会以任何方式通知您的应用程序。
Just do this to cancel all local notifications.
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.
当您的应用程序在后台被杀死时,您不会收到任何通知,也没有任何机会运行或清理。当您进入后台或等到您的应用程序返回前台时,您必须执行此操作。
当应用程序在后台从任务栏被杀死时,它会发送一个 SIGKILL 信号,该信号不能被信号处理程序捕获后,它会被立即终止,不会向应用程序发出警告。
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.