didRegisterForRemoteNotificationsWithDeviceToken

Hi,


I have a weird situation about trying to get device token from iPhone devices. I applied the rules about registration to remote notifications. In didFinishLaunchingWithOptions, UIApplication.shared.registerForRemoteNotifications() is implemented. Also isRegisteredForRemoteNotifications is true. However, didRegisterForRemoteNotificationsWithDeviceToken is not getting called. The most weird thing is while didRegisterForRemoteNotificationsWithDeviceToken is called in iPhone XR, but didRegisterForRemoteNotificationsWithDeviceToken is NOT CALLED in iPhone X, iPhone 8 sometimes. I also didFailToRegisterForRemoteNotificationsWithError is not called. Because there is no failed situation. All permission is given etc ...


I can't find any specific answer to my problem. didRegisterForRemoteNotificationsWithDeviceToken is not working some devices sometimes.


Thanks.

Replies

Do your devices start to work after reboot?

Yes. However, I do not understand the reason to reboot?

Same frustration here.

I'm seeing this too.

It works on some devices but not on others. And then the issue clears itself after a while (days) only to pop up again seemingly at random.

I had the same problem and haven't found the solution yet. Also, for me device reboots haven't always fixed the issue.

I have the same problem with iOS 4 on iPhone XR.
All of the iOS behaviour is different in iPhone XR :D
Reboot hasn't fixed my issue.
Hi, did anyone solve this problem?
I have exactly the same problem. Yesterday, everything worked smooth, today, on the same device, no code changes, the didRegisterForRemoteNotificationsWithDeviceToken does not get called (and didFailToRegisterForRemoteNotificationsWithError does also not get called). Last week the same happened, and a device restart "solved" it, but that did not work this time. I tried on another device as well, reinstalled the App, restarted Xcode, etc., it does not help, e.g. the function still does not get called.