didRegisterForRemoteNotificationsWithDeviceToken not called in ios8, but didRegister...Settings is
After a long dig I found that on 19 July, 2016 due to some error or updation at Apple's end , the didRegisterForRemoteNotificationsWithDeviceToken method would not be called even if every condition like Internet connection , Device and the methods used are perfect.
Refer to this link for confirmation https://forums.developer.apple.com/thread/52224
To verify please have a look in your other apps too. I had wasted my several hours but hope it helps someone. Thanks.
For 19 July, 2016:-
As per Apple Developer form, there is an issue regarding Sandbox APNS
down... so there may be issue from apple side,thats why delegates like application:didRegisterForRemoteNotificationsWithDeviceToken:
and application:didFailToRegisterForRemoteNotificationsWithError:
is not called..
To check current status of APNS Sandbox this link... By now according to status APNS Sandbox is working fine and its normal ... so may be there is some other bug from apple side
So just don't worry if your methods are perfect and certificates are valid. This is just an issue from Apple side .. as soon as issue solved, your methods works perfectly(if everything is fine from your side).
Note that Production is working fine .. so issue is regarding only Sandbox APNS.
I had this issue and finally found the note in Apple Developer web site and solved this issue:
Registering, Scheduling, and Handling User Notifications
iOS Note in the section: "Registering for Remote Notifications:
iOS Note: If a cellular or Wi-Fi connection is not available, neither the application:didRegisterForRemoteNotificationsWithDeviceToken: method nor the application:didFailToRegisterForRemoteNotificationsWithError: method is called. For Wi-Fi connections, this sometimes occurs when the device cannot connect with APNs over port 5223. If this happens, the user can move to another Wi-Fi network that isn’t blocking this port or, on an iPhone or iPad, wait until the cellular data service becomes available. In either case, the device should be able to make the connection, and then one of the delegation methods is called.
My iPhone only connected with Wifi, reboot iPhone and reconnect to WiFi AP solved this issue.