After installing our app we ask the user for permission to send them notifications. If they accept all works well and we get a devicetoken etc. My question is when the user initially declines the permission request, so RegisteredForRemoteNotifications won't be called and we won't get a devicetoken. Which is understandable because he declined. BUT if the user then manually turns on the notifications in the device settings, when will there be a devicetoken generated? I haven't been able to request the permission again, it won't show the request dialog and permission granted is automatically set to false.
I know how to check if the system notification permissions are granted, but I need the devicetoken to be set. Can anyone explain how this would work?
From the document:
You get the token from
RegisteredForRemoteNotificationsmethod and this method will be called at launch time.Another point you need to know is that when a user change permission manually in settings, your app will manually restart by iOS system.
So after user changed the setting, the app will relaunch and then get the device token.