【问题标题】:Expo push notifications - Error: Couldn’t get GCM token for deviceExpo 推送通知 - 错误:无法获取设备的 GCM 令牌
【发布时间】:2018-09-07 09:52:54
【问题描述】:

我尝试在 mt 应用上实现 Expo Notification, 非常连线,在我上次的 expo 应用程序中它运行良好,但现在却不行, 可能是因为版本更新 这是我尝试使用 expo 文档中的代码时显示的

Error: Couldn't get GCM token for device

这是 pacage.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"
  }
}

【问题讨论】:

  • 确保您已登录 Expo。当我再次登录时,我得到了改善。 expo.io 用户名和密码。 exp登录

标签: android react-native push-notification notifications expo


【解决方案1】:

刚刚通过使用 expo start 而不是 react-natives-scripts start 来修复它。 如果遇到 expo-cli 错误,请运行 npm install expo-cli --global

您可以找到更多与此错误相关的讨论here

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-05-08
    • 2012-02-06
    • 1970-01-01
    • 2020-04-28
    • 2015-07-08
    • 1970-01-01
    • 2010-11-23
    • 1970-01-01
    相关资源
    最近更新 更多