重新安装应用程序后,UILocalNotification将触发 [英] UILocalNotification fires after reinstalling the app

查看:175
本文介绍了重新安装应用程序后,UILocalNotification将触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序使用UILocalNotification具有闹钟功能,效果很好。但是,如果用户卸载应用程序,然后重新安装它,他将立即收到所有中间通知。

My app has an alarm function using UILocalNotification, and it works great. However, if the user uninstalls the app, then later REINSTALLS it, he would receive all the "in between" notifications at once.

我试图打电话:

[[UIApplication sharedApplication] cancelAllLocalNotifications];

如果它是第一次启动应用程序,但它没有帮助,因为通知是甚至在申请之前收到:didFinishLaunchingWithOptions:被调用。

if it's the first time the app is launched, but it doesn't help, because the notification is received even before application:didFinishLaunchingWithOptions: is called.

即使用户删除了应用程序,重复警报时4.0更糟糕但是至少那个bug是Apple在以后的版本中修复。但是现在我坚持这个。有人有想法吗?

This was worse in 4.0 when the alarm was repeated even if the user has deleted the app, but at least that bug was fixed by Apple in later release. However now I'm stuck with this. Anyone has an idea?

推荐答案

这实际上是iPhone中的一个错误。如果您删除了该应用程序并在以后安装它,它将具有相同的应用程序ID,因此当重新安装该应用程序时,即使您没有打开该应用程序,也会触发所有过去的本地通知。

This is actually a bug in iPhone. If you removed the application and install it later also, it will have same app id, so when the application is reinstalled all the past local notifications were fired even if u didnt open the app.

这篇关于重新安装应用程序后,UILocalNotification将触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆