didRegisterForRemoteNotificationsWithDeviceToken never called on specific device [duplicate] didRegisterForRemoteNotificationsWithDeviceToken never called on specific device [duplicate] xcode xcode

didRegisterForRemoteNotificationsWithDeviceToken never called on specific device [duplicate]


I got a similar problem, the code was already implemented and working fine.Suddenly, after some adjustments, it just don't work it anymore.

The scenario running on device was:

  • Call registerForRemoteNotifications on didFinishLaunchingWithOptions.
  • The didRegisterForRemoteNotificationsWithDeviceToken won't call
  • nor didFailToRegisterForRemoteNotificationsWithError won't call.

I tried everything, almost reset all push configurations and certificates and provisioning profiles, etc.. All devices with the last version was working, but when I install the new version, just don't work anymore.

To solve this, I just did this:

  1. Went to the target capabilities;
  2. Turn the Push Notification Off;
  3. Build & Run the app on device and wait;
  4. Stop running the app;
  5. Turn the Push Notification On again.
  6. Build & Run the app on device;
  7. And like magic, it worked again

After 6h fighting with Xcode, that was my solution, without any explanation.

I hope this help someone.


I was asked to debug similar behaviour on a clients app, under iOS9.

It turns out the app was calling registerUserNotificationSettings and registerForRemoteNotifications from the appDelegate as is common.

However, it was also doing this a second time shortly after in a subsequent permissionsViewController.

If a user declined the request resulting from the appDelegate then the subsequent attempts to allow notifications after a user had seen a rationale for allowing it (the second calls from the permissionsViewController) were set with types set to zero same as the appDelegate calls.

Removing the initial appDelegate calls and having only the permissionsViewController calls present solved this.


Another thing to check is the system status of APNS at Apple https://developer.apple.com/system-status/.

I was tearing my hair out wondering why I couldn't register my device while the APNS system was 'experiencing problems'.