You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Expo React Native项目未配置FCM API Key问题求助

解决Expo托管项目Android推送通知FCM API Key配置错误

我正尝试为托管式React Native Expo项目配置Android推送通知,已严格遵循官方指南《Push-notifications overview》和《Using FCM for Push Notifications for Android》。我为Android应用创建了新Firebase项目,在Cloud Messaging标签页复制了Server Key(FCM API Key),并将生成的google-services.json文件下载到Expo项目中,随后启动了新的EAS构建。但在终端执行expo push:android:show命令时,出现错误提示:There is no FCM API key configured for this project

  • 检查项目配置文件(app.json/app.config.js):
    必须在expo.push.android字段中明确配置FCM API Key,同时确保android.googleServicesFile指向正确的文件路径,示例配置:
    {
      "expo": {
        "android": {
          "googleServicesFile": "./google-services.json",
          "package": "com.your.app.package"
        },
        "push": {
          "android": {
            "apiKey": "你的FCM Server Key"
          }
        }
      }
    }
    
  • 清理缓存重新构建:
    运行eas build --platform android --clear-cache,避免旧缓存导致配置未生效
  • 手动上传FCM API Key:
    直接执行expo push:android:upload --api-key "你的FCM Server Key",将密钥同步到Expo服务器,之后再运行expo push:android:show验证
  • 核对Firebase配置:
    确保Firebase项目中注册的应用包名和Expo配置里的android.package完全一致,同时确认复制的是Firebase Cloud Messaging页面的最新Server Key(避免使用旧的或无效的密钥)

内容的提问来源于stack exchange,提问作者TheSoul

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.17 10:20:43