Expo Push Notification 无法检索收件人应用程序的 FCM 服务器密钥。确保您已按照指示提供了服务器密钥……
Posted
技术标签:
【中文标题】Expo Push Notification 无法检索收件人应用程序的 FCM 服务器密钥。确保您已按照指示提供了服务器密钥……【英文标题】:Expo Push Notification Unable to retrieve the FCM server key for the recipient’s app. Make sure you have provided a server key as directed… 【发布时间】:2021-02-08 17:07:39 【问题描述】:SDK 版本:40 平台(android/ios/web/all):Android
我已经设置了 expo push:android:show 错误返回我:
Click to see error img
如果我点击按钮就没有回报
我只是使用 Push Notifications Overview - Expo Documentation 1 中提供的示例代码
设置 expo push:android:show 和 fcm,firebase,推送,google-services.json 看:
Cick to see what I setted
我在 expo 弹出之前安装了 expo 依赖项。 我也将 Firebase 应用名称 com.myname.testpush 设置为 AndroidManifest 包名称。
“dependencies”:
“expo”: “~40.0.0”,
“expo-status-bar”: “~1.0.3”,
“react”: “16.13.1”,
“react-dom”: “16.13.1”,
“react-native”: “~0.63.4”,
“react-native-web”: “~0.13.12”,
“expo-notifications”: “~0.8.2”,
“expo-permissions”: “~10.0.0”,
“expo-splash-screen”: “~0.8.1”,
“expo-task-manager”: “~8.5.0”,
“expo-updates”: “~0.4.0”,
“expo-constants”: “~9.3.0”,
“@react-native-firebase/app”: “^10.5.0”,
“react-native-gesture-handler”: “~1.8.0”,
“react-native-reanimated”: “~1.13.0”,
“react-native-screens”: “~2.15.0”,
“react-native-unimodules”: “~0.12.0”
,
“devDependencies”:
“@babel/core”: “~7.9.0”,
“babel-jest”: “~25.2.6”,
“jest”: “~25.2.6”,
“react-test-renderer”: “~16.13.1”
,
也发布在博览会上:https://forums.expo.io/t/push-notification-unable-to-retrieve-the-fcm-server-key-for-the-recipients-app-make-sure-you-have-provided-a-server-key-as-directed/48529
【问题讨论】:
【参考方案1】:expo push:android:show(不是为我配置的)
然后 expo push:android:upload --api-key ,替换为您刚刚复制的字符串。 (要获取令牌,请查看https://docs.expo.io/push-notifications/using-fcm/#uploading-server-credentials)
【讨论】:
【参考方案2】:已在世博论坛上解决 (https://forums.expo.io/t/push-notification-unable-to-retrieve-the-fcm-server-key-for-the-recipients-app-make-sure-you-have-provided-a-server-key-as-directed/48529/2)
@adamjnav 创建一个新项目我可以看到我忘记设置我的 experienceId: "@myexpouser/myproject" 和我的 app.json android: ..., “useNextNotificationsApi”: true, “adaptiveIcon”:"...
【讨论】:
以上是关于Expo Push Notification 无法检索收件人应用程序的 FCM 服务器密钥。确保您已按照指示提供了服务器密钥……的主要内容,如果未能解决你的问题,请参考以下文章
Apple Push Notification - 无法回调 didRegisterForRemoteNotificationsWithDeviceToken
添加 React-Native-Camera 和 React-Native-Push-Notification 后无法构建 React Native
React Native Push Notification - react-native-fcm - ios无法构建
Android:不活动后,Expo Notification 未显示在锁定屏幕上