简体   繁体   English

Expo 推送通知:“错误:无法在设备上获取 GCM 令牌。”

[英]Expo Push Notifications: “Error: Couldn't get GCM token on device.”

I'm trying to receive push notifications with my Expo app, but at this line, the aforementioned error is thrown:我正在尝试使用我的 Expo 应用程序接收推送通知,但在这一行,会引发上述错误:

token = await Notifications.getExpoPushTokenAsync();

I already tried:我已经尝试过:

  • setting up a FireBase account and linking the server API key with expo push:android:upload --api-key <token>设置 FireBase 帐户并将服务器 API 密钥与expo push:android:upload --api-key <token>
  • downloading the google-services.json , linking it in app.json and making sure that android.package is set to the correct value下载google-services.json ,将其链接到app.json并确保 android.ZEFE90A8E604A7C847D8 设置为正确
  • logging into my expo account with expo login使用expo login到我的 expo 帐户
  • upgrading Expo to the newest version升级 Expo 到最新版本
  • building the app and running it as a standalone app on a physical device构建应用程序并将其作为独立应用程序在物理设备上运行

Unfortunately, nothing worked and I'm running out of ideas.不幸的是,没有任何效果,我的想法已经不多了。 Any suggestions?有什么建议么?

Okay, I just solved it by upgrading Expo to version 3.17.24 .好的,我刚刚通过将 Expo 升级到版本3.17.24解决了这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Expo:“错误:无法在设备上获取 GCM 令牌” - Expo: “Error: Couldn’t get GCM token on device” 无法获取设备的推送令牌。 检查您的 FCM 配置是否有效 - Couldn't get push token for device. Check that your FCM configuration is valid 尝试获取用于推送通知的 expo 设备令牌的错误消息 - Error message trying to get expo device token for push notifications getExpoPushTokenAsync出现问题,错误“无法获取设备的GCM令牌” - problem with getExpoPushTokenAsync with error “Couldn't get GCM token for device” 世博互动推送通知 - Expo Interactive Push Notifications Phonegap推送通知获取设备ID - Phonegap push notifications get device ID 对话推送通知中的 Twilio“GCM/FCM 未授权错误:GCM/FCM API 密钥已撤销或无效” - Twilio "GCM/FCM unauthorized error: GCM/FCM API key is revoked or invalid" in conversations push notifications Expo Push Notifications - 在特定屏幕中禁用通知 - Expo Push Notifications - Disable notifications in a specific screen 通过GCM在渐进式Web应用程序中推送通知 - Push notifications in Progressive web app through GCM Expo 推送通知不适用于 Android 独立应用程序 - Expo push notifications not working on Android standalone app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM