Android中的Firebase:无效的服务器密钥已发送或发件人无权执行请求

时间:2017-02-14 09:44:46

标签: php android json firebase firebase-cloud-messaging

这是PHP文件的一部分。

// Firebase config
define("FIREBASE_SERVER_KEY", "key");

我在Firebase网页上找到了该密钥。这是服务器密钥,而不是Web API密钥。

当我尝试发送推送通知时,我收到消息Invalid Server-key delivered or Sender is not authorized to perform request。所以现在我去了我下载并粘贴到应用程序的google-services.json文件,就在这里。

{
  "project_info": {
    "project_number": "109514033229",
    "firebase_url": "https://authentication-d186e.firebaseio.com",
    "project_id": "authentication-d186e",
    "storage_bucket": "authentication-d186e.appspot.com"
  },
  "client": [
    {
      "client_info": {
        "mobilesdk_app_id": "1:109514033229:android:9cbb45c552e1d290",
        "android_client_info": {
          "package_name": "com.marshall.authentication"
        }
      },
      "oauth_client": [
        {
          "client_id": "109514033229-3vtiahoqpoj5laukd8l3mcbr3gsmofhv.apps.googleusercontent.com",
          "client_type": 3
        }
      ],
      "api_key": [
        {
          "current_key": "current_key"
        }
      ],
      "services": {
        "analytics_service": {
          "status": 1
        },
        "appinvite_service": {
          "status": 1,
          "other_platform_oauth_client": []
        },
        "ads_service": {
          "status": 2
        }
      }
    }
  ],
  "configuration_version": "1"
}

此错误是否与此JSON文件有关?或者我应该怎么做才能解决这个问题?

0 个答案:

没有答案