const token = await Notifications.getExpoPushTokenAsync()
await axiosConfig.post("pushToken", { token });
此代码可完美地在(生产模式和Expo Client应用程序)上使用 当我使用expo build:Android for APK。调用此函数时,应用程序崩溃
答案 0 :(得分:0)
尝试: 对于./google-services.json:
string.1 <- " starts with 4 spaces"
nchar(sub("\\S.*$", "", string.1))
请创建app.json:
{
"project_info": {
"project_number": "…",
"firebase_url": "…",
"project_id": "…",
"storage_bucket": "…"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "…",
"android_client_info": {
"package_name": "…"
}
},
"api_key": [
{
"current_key": "KEY_KEY_KEY_KEY_KEY"
}
]
},
https://github.com/expo/expo/issues/7727#issuecomment-611544439
答案 1 :(得分:0)
我遇到了类似的问题,我通过在我的设备上为 Expo 客户端启用通知解决了这个问题。