Unregistering From Push Notifications
suggest changeTo unregister from remote notifications programmatically you can use the following. This is Swift 2. It unregisters the app with APNs. It is not the same as the user turning Notifications off in Settings, and the system may register the app again later.
Objective-C
[[UIApplication sharedApplication] unregisterForRemoteNotifications];
Swift
UIApplication.sharedApplication().unregisterForRemoteNotifications()
NOTE: There may be rare cases where you would need this (for example, when your app no longer supports push notifications).
If you just want to allow the user to temporarily disable notifications, remove the device token from the database on your server. If you only disable notifications locally, your server will still send messages.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents