Expo IOS Device Token is not formatted correctly.

Please provide the following:

  1. SDK Version: 36.0
  2. Platforms(Android/iOS/web/all): IOS

My team and I are using PubNub to handle our Push Notifications for our IOS and Android App. We are using Notifications.getDevicePushTokenAsync() method from expo to get the proper Device Token. This seems to work for Android/FCM but not working at all for IOS APNS2. I am able to manually test my APNS2 setup and it works as expected when provided a valid token. When provided the token from Notifications.getDevicePushTokenAsync() it fails with the following error Failed: Wrong device token. iOS device token cannot contain special characters. It must be a string with 64 hexadecimal symbols. Example: "03ds25c845d461bcdad7802d2vf6fc1dfde97283bf75cn993eb6dca835ea2e2f. The following is a sample token retrieved from Notifications.getDevicePushTokenAsync(), 685f0c2630a5ab7fd59123362695734b5914140997ac6a18fb3595e-b5a2a8be4. APNS2 seems to like to the token when the dash is removed. Has anyone else seen this issue? Expo team, could this be related to the following article? How can I get the Device token without the dashes? iOS 13 and Xcode 11 Changes That Affect Push Notifications. I know that IOS 13 had some breaking changes when it came to IOS notifications.

Thanks,

Steve.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.