简体   繁体   English

Expo推送通知 - 错误:无法获取设备的GCM令牌

[英]Expo push notifications - Error: Couldn’t get GCM token for device

i try to implement Expo Notification on mt app, very wired, in my last expo app it work well but now it's doesn't, maybe because the versions update this is show when i try the code from expo documentation 我尝试在mt应用程序上实现世博通知,非常有线,在我的上一个世博会应用程序中运行良好,但现在它没有,可能是因为版本更新这是显示当我尝试从expo文档的代码

Error: Couldn't get GCM token for device

and this is the pacage.json: 这是pacage.json:

My package.json: 我的package.json:

{
  "name": "blabla",
  "version": "0.1.0",
  "private": true,
  "devDependencies": {
    "babel-plugin-transform-decorators-legacy": "^1.3.5",
    "jest-expo": "~27.0.0",
    "react-native-scripts": "1.14.0",
    "react-test-renderer": "16.3.1"
  },
  "main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
  "scripts": {
    "start": "react-native-scripts start",
    "eject": "react-native-scripts eject",
    "android": "react-native-scripts android",
    "ios": "react-native-scripts ios",
    "test": "jest"
  },
  "jest": {
    "preset": "jest-expo"
  },
  "dependencies": {
    "es6-symbol": "^3.1.1",
    "expo": "^29.0.0",
    "firebase": "^5.4.1",
    "mobx": "^4.3.1",
    "mobx-react": "^5.1.0",
    "react": "16.3.1",
    "react-native": "~0.55.2",
    "react-native-animatable": "^1.3.0",
    "react-native-ionicons": "^0.2.2",
    "react-native-progress": "^3.5.0",
    "react-native-simple-toast": "0.0.8",
    "react-navigation": "^2.11.0"
  }
}

Just fixed it by using expo start instead of react-natives-scripts start . 只是通过使用expo start而不是react-natives-scripts启动来修复它。 If u get expo-cli error, run npm install expo-cli --global . 如果你得到expo-cli错误,请运行npm install expo-cli --global

You can find more discussion related to this error here 您可以在此处找到与此错误相关的更多讨论

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

相关问题 Expo 推送通知:“错误:无法在设备上获取 GCM 令牌。” - Expo Push Notifications: “Error: Couldn't get GCM token on device.” 尝试在 React Native 中从我的 Android 设备获取推送令牌时出现“无法获取设备的 GCM 令牌”,但出现此错误: - "Couldn't get GCM token for device" when trying to get the Push Token from my Android device in React Native but I get this error: 无法使用Cordova推送通知插件获取设备令牌 - Can't get device token using Cordova Push Notifications Plugin 如何获取用于推送通知的 Android 设备令牌? - How to get Android device token for push notifications? 无法获取设备的推送令牌。 检查您的 FCM 配置是否有效 - Couldn't get push token for device. Check that your FCM configuration is valid Android推送通知设备令牌 - Android push notifications device token 无法获取 expo 推送令牌 - Can not get expo push token 用于推送通知的GCM(Google云消息传递)的令牌ID - Token id for GCM(Google cloud messaging) for push notifications 我的Android设备从gcm没有收到推送通知? - push notifications are not received in my android device from gcm? Android gcm推送通知可以在模拟器上完美运行,但不能在设备上运行? - Android gcm push notifications working perfectly on emulator but not on device?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM