Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IOS Cancelling Local Notifications

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?

like image 231
ardavar Avatar asked Aug 19 '13 23:08

ardavar


People also ask

What is local notification in IOS?

Local notifications reach users whether your app is running in the foreground or the background and require no external infrastructure to send, which is why they are aptly termed “local.” These notifications simply require that a user's device is on in order to be received.

What is the difference between local notification and push notification?

The essential difference between local notifications and push notifications is simple: Local notifications are scheduled by an app locally and are delivered by the same device. Push notifications are sent by a remote server (its provider) which sends these notifications to devices on which the app is installed.

How many local notifications can be scheduled IOS?

As you are already aware, you can schedule maximum of 64 notifications per app. If you add more than that, the system will keep the soonest firing 64 notifications and will discard the other.


1 Answers

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];
like image 180
danielbeard Avatar answered Sep 30 '22 19:09

danielbeard