Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do UILocalNotifications persist after uninstall/update?

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).

like image 575
Fr4ncis Avatar asked Jun 24 '15 13:06

Fr4ncis


Video Answer


1 Answers

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.

like image 175
Andrea Avatar answered Sep 27 '22 17:09

Andrea