iOS 13 beta device token generation issue

Hi,


I have updated my iOS device to iOS 13 beta 7 to test the push notifications feature in my application. I have seen a strange behaviour where didRegisterForRemoteNotificationsWithDeviceToken method wasn't getting called even after allowing the remote notifications. I tried to debug by putting the break point in didRegisterForRemoteNotificationsWithDeviceToken which was of no use. So when i tried to search about this device token generation issue in iOS 13 beta i got to see a post in which they suggested to restart the device to make it work. And surprisingly when i restart the decvice it worked and i am able to use the generated device token to register for push notifications. Did anyone face the same issue? Will this be resolved in next beta version or in main release?

Replies

Hey, i am seeing the same issue with the iOS13 GM. The exact same code works in iOS12 without problems...


It seems to work in a productive environment on iOS 13. Maybe the problem is resticted to the dev environment if you build with xcode.

Could be related to this...

https://nshipster.com/apns-device-tokens/

I don't think it's related to this. The link you've posted talks about the problem many developers have had with NSData's description property which changed since iOS 13. This thread is addresses the issue that very often, when building with debug config from xcode at least, application's delegate methods that inform us whether the APNs token was generated successfully or not, do not get called at all. And yes, if you restart the device it starts working again only to stop after an unknown period of time.

Hope somebody from Apple responds to this thread and informs us wether this is a bug they'll fix soon or maybe intended functionality for debug apps.

Does this issue still there in iOS 13.3?

i also didnt receiving devicetoken sometimes and as you you guys suggested, after restarting my device i am able to receive device token.


Any other solution for this?

From my teams perspective the problem is related to not using iPhones without SIM card in development. After we put a SIM card in the device it worked like a charm.

I'm testing without a sim card and seems to work, but I have some devices out there with the SIM and it's not working...

I'm still investigating this issue!

I am also facing this problem but not on any device. On iPhone XS the event is called, on iPhone 7 not. Both phones have exactly the same iOS Version 13.4.1.


Even using a sim card in the iPhone 7 doesn't solve this problem. The app is asking to send push messages but the event does not get fired after allowing the messages.

I am having the exact same issue on IPhone X 13.4.1 and I have a sim card in it. I totally create test project to test this but same thing is happening application is asking for permission but not going into didregister function anyway how to solve this **** thing.

As of 2020, April 27th, I am having the exactly same issue in 13.4.1. I am testing on Ipad 6th generation 13.4.1, Iphone 8+ 13.4.1, and iPad Pro(12.9-inch) 13.4.1. Both ipads are connected to wifi and im testing my iphone on cellular with a sim card. When I first built the project from xcode in all of my devices, didRegisterForRemoteNotificationsWithDeviceToken and didFailToRegisterForRemoteNotificationsWithError didn't run at all. And when i reboot the device, it started to work again. I couldn't get exactly why this is happeneing. For iPads, the situation is worse because after rebooting the device it seems to work a little for a while and after sometime it stops working until i reboot the device again.

Did you find the solution for this problem?

We're finding the same issue with a TestFlight tester who is using a public invite link. The token is not updating at all, restarting the device hasn't worked but we're looking into diffrent combinations of network settings now.


One thing I have noticed is that on the TestFlight group page there are 2 users with the app installed, and the user who is having the issue isn't counting towards the "Tester Count" or showing an "Invitation Type" or "Name" in the table of testers, not even 'Anonymous', but sessions and install are recorded.

I noticed the same, devices without SIM periodically have issue 😟 with receiving device token and from other side devices WITH SIM works like a charm 🙂. Such behaviour applicable for the iOS 13.

Same problem here both with 13.4.1 and 13.5 on iphone 11 pro. Anyobdy has any solution to this?


I made an ADHOC build and deployed build to a phone (13.4.1) OTA. Call backs did not work either and push was dead.


Restarting device did not work for me. What worked for me was doing the volumen up then down then hold down power until slide to turn off shows up. After it restarted like that the callbacks worked right away.

Similar issue is happening with me as well. I am not able to generate development token on my device, no delegates are called. I have restarted my device several times, but no luck.
My device is able to generate a production token when signed with the same account, just that it's not working in development.


Do we have any limit on generating development token per device per account ? This use to work fine earlier and suddenly stopped.

Device Deatils : iPhoneX 13.4.1
Xcode : 11.4.1


Same problem with iPad Air 2, iOS 13.5.1. The same app is working on iPad 6 version 13.3. This is becoming ridiculous.