Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Firebase 在模块ExpoPushTokenManager上执行导出的方法getDevicePushTokenAsync时发生异常_Firebase_React Native_Expo_Android Push Notification_React Native Push Notification - Fatal编程技术网

Firebase 在模块ExpoPushTokenManager上执行导出的方法getDevicePushTokenAsync时发生异常

Firebase 在模块ExpoPushTokenManager上执行导出的方法getDevicePushTokenAsync时发生异常,firebase,react-native,expo,android-push-notification,react-native-push-notification,Firebase,React Native,Expo,Android Push Notification,React Native Push Notification,我升级了expo推送通知,每当我在Android上运行它时,都会出现以下错误: 执行导出的方法时发生异常 模块ExpoPushTokenManager上的getDevicePushTokenAsync。请设定 您的项目ID。需要有效的firebase项目ID才能 与Firebase服务器API通信:它使用 古尔奇 有人能告诉我应该把项目ID放在哪里吗?我在我的config.js文件中将它链接到我的项目中,但我觉得它也应该在我的app.json文件中,只是不能100%确定在哪里 { "

我升级了expo推送通知,每当我在Android上运行它时,都会出现以下错误:

执行导出的方法时发生异常 模块ExpoPushTokenManager上的getDevicePushTokenAsync。请设定 您的项目ID。需要有效的firebase项目ID才能 与Firebase服务器API通信:它使用 古尔奇

有人能告诉我应该把项目ID放在哪里吗?我在我的
config.js
文件中将它链接到我的项目中,但我觉得它也应该在我的
app.json
文件中,只是不能100%确定在哪里

{
  "expo": {
    "name": "Galavant",
    "slug": "Galavant",
    "platforms": ["ios", "android", "web"],
    "version": "2.0.8",
    "orientation": "portrait",
    "icon": "./assets/logo.png",
    "splash": {
      "image": "./assets/logo_original.png",
      "resizeMode": "contain",
      "backgroundColor": "#ffffff"
    },
    "updates": {
      "fallbackToCacheTimeout": 0
    },
    "assetBundlePatterns": ["**/*"],
    "ios": {
      "usesAppleSignIn": true,
      "infoPlist": {
        "NSCameraUsageDescription": "So you can add photos to your profile.",
        "NSPhotoLibraryUsageDescription": "So you can add photos to your profile.",
        "NSLocationWhenInUseUsageDescription": "So you can connect with people nearby."
      },
      "supportsTablet": true,
      "bundleIdentifier": "com.test.test",
      "buildNumber": "0.0.1",
      "config": {
        "googleSignIn": {
          "reservedClientId": "com.googleusercontent.apps.12346789"
        }
      }
    },
    "android": {
      "package": "com.test.test",
      "useNextNotificationsApi": true,
      "versionCode": 5,
      "config": {
        "googleMaps": {
          "apiKey": "asdkjfkasjdf9837983rlkajshf"
        },
        "googleSignIn": {
          "apiKey": "asdkjfkasjdf9837983rlkajshf", 
          "certificateHash": "33345w4sdfasdkjfkasjdf9837983srlkajshf"
        }
      },
      "permissions": [
        "ACCESS_COARSE_LOCATION",
        "ACCESS_FINE_LOCATION",
        "CAMERA",
        "MANAGE_DOCUMENTS",
        "READ_CONTACTS",
        "READ_CALENDAR",
        "WRITE_CALENDAR",
        "READ_EXTERNAL_STORAGE",
        "READ_PHONE_STATE",
        "RECORD_AUDIO",
        "USE_FINGERPRINT",
        "VIBRATE",
        "WAKE_LOCK",
        "WRITE_EXTERNAL_STORAGE",
        "com.anddoes.launcher.permission.UPDATE_COUNT",
        "com.android.launcher.permission.INSTALL_SHORTCUT",
        "com.google.android.c2dm.permission.RECEIVE",
        "com.google.android.gms.permission.ACTIVITY_RECOGNITION",
        "com.google.android.providers.gsf.permission.READ_GSERVICES",
        "com.htc.launcher.permission.READ_SETTINGS",
        "com.htc.launcher.permission.UPDATE_SHORTCUT",
        "com.majeur.launcher.permission.UPDATE_BADGE",
        "com.sec.android.provider.badge.permission.READ",
        "com.sec.android.provider.badge.permission.WRITE",
        "com.sonyericsson.home.permission.BROADCAST_BADGE"
      ]
    },
    "notification": {
      "icon": "./assets/PushNotification.png"
    }
  }
}

我最后做了几件事。首先,我创建并添加了
googleservices.json
文件。我在
“web”
部分添加了项目ID,最后用
useNextNotificationsApi

"android": {
  "package": "com.test.test",
  "googleServicesFile": "./google-services.json",
  "useNextNotificationsApi": true,
  "versionCode": 10,
  "config": {
    "googleMaps": {
      "apiKey": "123456789"
    },
    "googleSignIn": {
      "apiKey": "123456789",
      "certificateHash": "123456789asdfasdf"
    }
  },
  "permissions": [
    "ACCESS_COARSE_LOCATION",
    "ACCESS_FINE_LOCATION",
    "CAMERA",
    "USE_FINGERPRINT",
    "VIBRATE"
  ]
},
"web": {
  "config": {
    "firebase": {
      "projectId": "testprojectID",
      "apiKey": "123456789",
      "measurementId": "measurementid123"
    }
  }
},

我最后做了几件事。首先,我创建并添加了
googleservices.json
文件。我在
“web”
部分添加了项目ID,最后用
useNextNotificationsApi

"android": {
  "package": "com.test.test",
  "googleServicesFile": "./google-services.json",
  "useNextNotificationsApi": true,
  "versionCode": 10,
  "config": {
    "googleMaps": {
      "apiKey": "123456789"
    },
    "googleSignIn": {
      "apiKey": "123456789",
      "certificateHash": "123456789asdfasdf"
    }
  },
  "permissions": [
    "ACCESS_COARSE_LOCATION",
    "ACCESS_FINE_LOCATION",
    "CAMERA",
    "USE_FINGERPRINT",
    "VIBRATE"
  ]
},
"web": {
  "config": {
    "firebase": {
      "projectId": "testprojectID",
      "apiKey": "123456789",
      "measurementId": "measurementid123"
    }
  }
},

我也有同样的问题,你解决了吗?@MehmetYenerYılmaz我解决了,我刚刚添加了我的解决方案。希望有帮助!我也有同样的问题,你解决了吗?@MehmetYenerYılmaz我解决了,我刚刚添加了我的解决方案。希望有帮助!