【发布时间】:2020-12-21 16:02:51
【问题描述】:
我升级了我的世博会推送通知,每当我在 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"
}
}
}
【问题讨论】:
-
我也有同样的问题,你解决了吗?
-
@MehmetYenerYılmaz 我做到了,我刚刚添加了我的解决方案。希望对您有所帮助!
标签: firebase react-native expo android-push-notification react-native-push-notification