Notification of notifications settings update

I have read the main article about notifications and the more elaborate documentation but I'm left with some questions.


  1. When the user is prompted to opt in for notifications, the didRegisterForRemoteNotificationsWithDeviceToken will be triggered, correct? I receive some kind of device token in this function that I can send to my server, so I can notify this device through that token, correct?
  2. So what happens when the user opts out of notifications through the settings menu? Does my app receive a function call I can handle? How can I notify my server that the device token is no longer used or that the notifications are disabled?
  3. Now the user has no notifications, but feels he/she should opt back in and does so via the settings again. Do I get a call in my app I can handle? Is the device token different from before? If I do not get a call I can handle, but the device does have a new device token, how do I notify this to my server?
  4. And last but not least, after uninstalling and reinstalling my app, does the app store the settings of the notifications (permissions and/or device token).


Thanks in advance!

Craz1k0ek

Answered by PBK in 353933022

4. delete and reinstall of the app will reset the 'allow notifications' to 'no'.


2. and 3. Not the ideal answer but - your app can routinely call requestAuthorizationWithOptions: and get a 'granted' value back. Your app can report that to your server.

Accepted Answer

4. delete and reinstall of the app will reset the 'allow notifications' to 'no'.


2. and 3. Not the ideal answer but - your app can routinely call requestAuthorizationWithOptions: and get a 'granted' value back. Your app can report that to your server.

And for 3. I assume I do receive a new device token, where would the call be that takes care of that? Is that again in didRegisterForRemoteNotificationsWithDeviceToken,or are there other means to retrieve the new token?

I assume there would be a new token generated. I only use notifications generated by CKQuerySubscriptions in CloudKit.

🙈🙉🙊

Notification of notifications settings update
 
 
Q