Is there a way to know when an app is deleted in iOS?

风流意气都作罢 提交于 2019-12-03 12:21:47

问题


my problem is this:

I have scheduled some UILocalNotifications on an iOS app, the problem is that if I delete the app without deleting the objects associated with the notifications (and consequently removing the notifications from the scheduledNotifications array) the notifications still fire.

Although I have not experienced them actually firing (they are set to repeat within a week's interval) I have evidence of this since I NSLog the scheduledNotifications array at application launch, which even after deleting the app and reinstalling it (with the entities of the data model gone), still shows some scheduled notifications.

I've searched the UIApplication and the UIApplicationDelegate reference in Apple's reference library but I found no method to know if the app is being deleted, if there is I would just write

[[UIApplication sharedApplication] cancelAllLocalNotifications];

in said method.

So, is there a way for knowing this?

Thank you in advance, your help is very much appreciated.


回答1:


This was bug in 4.0 that the local notification was repeated even if the user has deleted the app, but at least that bug was fixed by Apple in later release.



来源:https://stackoverflow.com/questions/4999234/is-there-a-way-to-know-when-an-app-is-deleted-in-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!