Unable to get expo push token in app from TestFlight


#1

I cannot get expo push token on app from TestFlight.
(I can get the token on Expo app.)

In app from TestFlight, return value from Permissions.askAsync(Permissions.NOTIFICATIONS) after selecting “Allow” on popup is below.

{
    "status": "undetermined",
    "expires": "never",
    "permissions": {
        "notifications": {
            "expires": "never",
            "allowsAlert": true,
            "allowsBadge": true,
            "allowsSound": true,
            "status": "undetermined"
        }
    }
}

I suspect that the cause is that “Push Notifications” are not included in “Enabled Services” of “iOS Provisioning Profiles”. (Checked it from https://developer.apple.com)

Do I need to add settings in app.json or else?


#2

Hey @toiroakr,

You should not need to make any modifications in your app.json to have push notifs working. What SDK version is your TestFlight .ipa built with?

Cheers,
Adam


#3

@adamjnav
Thanks for replying.

I use SDK version 31.


#4

I am having the same problem on IOS Standalone Build. I’m using SDK v31. The permission is correctly obtained on Expo app but on IOS Testflight build with SDK v31 it returns “undetermined”. Help please i tried to rebuilt several times but still the same. I also delete all the certificates from my Apple Developers Account and choose to let Expo handle those for me but still is not working. Thanks


#5

Hello guys, I’m having the same problem. Please help us.


#6

Hey @toiroakr. Your suspicion is right.

The error is related with => IOS push notification permission status undetermined

In our case our APP ID had the “Push Notifications Service” disabled, we enabled it, refresh the Provisioning Profile so it listed the Push Notification Service as enabled and generate a new build. Now the status of the permission is correct and it returns the correct Expo Token :slight_smile:


#7

Yes @perdida_peso , finally, this solved my issues, too. Here in details:

  1. I cleared and removed all Cert and Keys
  2. I made sure push notifications are in position “configurable” in APP ID
  3. I used expo-cli with (all) --clear-* options
  4. I choose expo to handle all certs and keys

Now it works

Versions:
expo-cli 2.10.1
expo sdk 32


#8

Awesome! Happy Coding! :slight_smile: