atlas atlas - 4 months ago 16
Swift Question

Can't get rid of scheduled push notifications - iOS

I have a very silly problem, which I unfortunately don't really understand how to solve.

I'm trying to implement push notification to my iOS app (Swift). I did succeed to create scheduled push notifications, where I send a notification every minute, for test purposes. Now I don't seem to be able to remove this, even though I have removed the code related to it, and reinstalled the app on the device. The only thing working is to disable push notifications in Xcode, which I do not want to do. It seems like I have missed something fundamental about the concept.

I did use an APN Tester at first to send messages to the device, but I don't think that has to do with anything.

Silly question, but I hope someone could help me.
Thanks!

Answer

Use this to remove all local notification:

UIApplication.sharedApplication().cancelAllLocalNotifications()