-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[iOS] Notifications.getExpoPushTokenAsync() - Error Notification registration failed: "Push Notifications" #19720
Comments
I started have this exact warning all of sudden. The warning still there even if I remove |
I removed this method if I still get the warning, finally the warning doesn't show anymore. Maybe you have the same issue as me or you have something else which can break Notifications. Anyway, I am in contact with the Expo team (via secure@expo.io) to solve this issue. They're debugging the Expo Core Code. I make a search for this error and in forums, it corresponds to => No valid 'aps-environment' entitlement string found for application. |
I don't know what is happening, this started all of sudden and my notifications stopped working. |
I have resolved this issue with building my app with EAS but I have some issues with it. |
I resolved the issue. Warning disappeared and Notifications working now. It was from In my case I had a
|
This issue is stale because it has been open for 60 days with no activity. If there is no activity in the next 7 days, the issue will be closed. |
This issue was closed because it has been inactive for 7 days since being marked as stale. Please open a new issue if you believe you are encountering a related problem. |
In case someone else runs into this, we found that the OneSignal Expo Plugin docs recommend to put the plugin first in the array: https://github.com/OneSignal/onesignal-expo-plugin/blob/main/README.md#plugin |
Summary
Since a little time, I no longer get the Expo Token in all my apps in production. I revoke my provisioning profile with the expo command line for a new one, I have the Push Notification key in my Apple Developer Credentials but it's still not working anymore.
No issues when i'm using Expo Go app to get the push token.
I put try/catch function to see why this not working on my build app. Here's a screenshot with the error message.
Error Notification registration failed: "Push Notifications" capability hasn't been added to the app in current environment : No valid 'aps-environment' entitlement string found for application
I tried everything from the Expo documentation troubleshooting but nothing is working.
I'm using expo-cli to build my app (classic system). Expo SDK 45. Only on iOS.
What platform(s) does this occur on?
iOS
Environment
expo-env-info 1.0.5 environment info:
System:
OS: macOS 12.6
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.13.2 - /usr/local/bin/node
Yarn: 1.22.17 - /usr/local/bin/yarn
npm: 8.1.2 - /usr/local/bin/npm
Watchman: 2021.09.06.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.11.3 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.4, iOS 16.0, macOS 12.3, tvOS 16.0, watchOS 9.0
IDEs:
Android Studio: 2021.2 AI-212.5712.43.2112.8609683
Xcode: 14.0.1/14A400 - /usr/bin/xcodebuild
npmPackages:
expo: 45.0.6 => 45.0.6
react: 17.0.2 => 17.0.2
react-dom: 17.0.2 => 17.0.2
react-native: 0.68.2 => 0.68.2
react-native-web: 0.17.7 => 0.17.7
npmGlobalPackages:
eas-cli: 0.54.1
expo-cli: 6.0.6
Expo Workflow: managed
Minimal reproducible example
const registerForPushNotificationsAsync = async () => {
if (Device.isDevice) {
const { status: existingStatus } = await Notifications.getPermissionsAsync()
let finalStatus = existingStatus
if (existingStatus !== "granted") {
const { status } = await Notifications.requestPermissionsAsync()
finalStatus = status
}
if (finalStatus !== "granted") {
console.log("�[" + 32 + "m" + "Failed to get push token for push notification! : " + "�[0m")
return
}
try {
const token = (await Notifications.getExpoPushTokenAsync()).data
console.log(token)
} catch (error) {
Alert.alert("error", error.toString())
}
} else {
console.log("Must use physical device for Push Notifications")
}
}
The text was updated successfully, but these errors were encountered: