- SDK Version: 45
- Platforms(Android/iOS/web/all): iOS
- Managed workflow, EAS Local Build
I have the following code block that used to work before, but doesn’t seem to work correctly anymore…
const getPushNotificationPermissions = async () => {
try {
const { status: existingStatus } = await Notifications.getPermissionsAsync();
let finalStatus = existingStatus;
if (existingStatus != 'granted') {
const { status } = await Notifications.requestPermissionsAsync({
ios: {
allowAlert: true,
allowBadge: true,
allowSound: true,
allowAnnouncements: true,
},
});
finalStatus = status;
}
if (finalStatus != 'granted') {
Alert.alert('You need to enable permissions in settings to receive push notifications');
return null;
}
// fails here
return await Notifications.getExpoPushTokenAsync();
} catch (e) {
console.error(
'Unable to get notification access, most likely because we ar running in a simulator',
e
);
return null;
}
};
I have an EAS build (using eas-local-build-plugin) with the current eas and plugins installed (I didn’t lock the version during the build process so it always does npm -g eas-cli expo-cli eas-cli-local-build-plugin
as part of the build to make sure I get the current ones.
I had reuploaded the certificates using eas credentials
My EAS build looks like this on Azure pipelines
- bash: |
eas build --platform=${{ parameters.platform }} --profile=${{ parameters.profile }} --non-interactive --local
env:
EXPO_TOKEN: $(expoToken)
EAS_DEBUG: "true"
EAS_LOCAL_BUILD_WORKINGDIR: $(Agent.TempDirectory)/$(Build.BuildId)
EAS_LOCAL_BUILD_ARTIFACTS_DIR: $(Build.ArtifactStagingDirectory)
The error I got logged was
received: 400 (body: “{“errors”:[{“code”:“VALIDATION_ERROR”,“message”:“The Expo push notification service is supported only for Expo projects. Ensure you are logged in to your Expo developer account on the computer from which you are loading your project.”,“isTransient”:false}]}”).
This is on a real device from a test flight build.
In eas credentials
I see the push key associated
Push Key
Developer Portal ID XXXXXXXXX
Apple Team YYYYYYYYYY
Updated 26 minutes ago
The eas.json
looks like this
{
"build": {
"production": {},
"preview": {
"android": {
"buildType": "apk"
},
"distribution": "internal"
},
"development": {
"developmentClient": true,
"distribution": "internal"
}
},
"cli": {
"version": ">= 0.35.0"
}
}
Another thing I noticed is that I don’t get any errors on Expo Go