Disable Push Notification By Swift
2 answers
From the app, this is almost impossible, but you can set your change to your Service, which sends a Push Notification.
If you are using APNS
, you must send a device token to your server to send a push notification.
You can make a call to the server to disable it using the token of the device you passed. You can make a call when the value of the switch changes.
+2
source to share
Use this ...
When you first enable push-push-enabled apps for push notifications, iOS asks the user if they want to receive notifications for that app. Once the user has responded to this warning, it will not be re-submitted unless the device is restored or the app is uninstalled for at least one day.
if types == UIRemoteNotificationType.None {}
UIApplication.sharedApplication().registerUserNotificationSettings(UIUserNotificationSettings(forTypes: UIRemoteNotificationType.Badge | UIRemoteNotificationType.Sound | UIRemoteNotificationType.Alert, categories: nil))
-1
source to share