问题
I dont like asking vague questions but I couldnt exactly tell what the problem is.
In my app I set some daily local notifications. Shooting everyday at 200PM. I later removed the codes that sets the local notifications, and added push notification feature.
I test the push and it works (whenever I want to). But I still get the old notifications as well, could it be because I set them earlier somewhere on the phone itself. Is there a way to cancel them without coding. For example are they cancelled if I remove the app?
回答1:
Uninstalling the app will remove the local notifications, although some people have reported that they are cached for up to 24 hours (so if you delete the app, don't reinstall it for more than 24 hours) See here for more details.
Otherwise, if you still have access to the code you can cancel all local notifications like this:
[[UIApplication sharedApplication] cancelAllLocalNotifications];
来源:https://stackoverflow.com/questions/18324473/ios-cancelling-local-notifications