Do UILocalNotifications persist after uninstall/update?

170 Views Asked by At

It seems that UILocalNotifications scheduled by our app are fired even if the app gets overwritten with the production app (OK, expected behaviour) but also if the app gets uninstalled and then installed again. Did anyone experience this? (I am double checking and keeping the question as reference, did not find any duplicates).

2

There are 2 best solutions below

2
On BEST ANSWER

Sort of... they persists after unistall of the app probably for some hours, but they are not fired.
You can test by yourself, launch your app in debug schedule some notifications, delete the app, install the app again and ask UIApplication for its scheduled notifications. You should see them again.
I think that Apple created this pattern to avoid accidental unistallations.
If you want to delete them create a BOOL flag in NSUserDefault to understand if it is the app first launch. If it is delete all the notifications.
NSUSerDefault doesn't persist after unistall (Keychain yes), so when you delete the app you can be sure that at the next install notifications will be wiped out.

0
On

If, on iOS 8.3, a UILocalNotification with a two minutes delay gets scheduled, then the app gets uninstalled and installed again, the notification gets fired.