Local Notification gets fired even when remove app from simulator

112 Views Asked by At

i am implementing UserNotification in an app, Now the thing is that once i set a notification with repeat of every minute, it works fine. Once i remove app from simulator and install again, the old set notification keeps on striking.Don't it get removed if i remove app from simulator? Any help !!

1

There are 1 best solutions below

2
pronebird On

Notifications may be scheduled for some time even after you remove and reinstall the app. Make sure that you cancel all scheduled notifications on the first run of your application.

You can use NSUserDefaults or on-disk storage to store a flag to find when your app runs in the very first time.