Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/firebase/6.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
Google chrome Chrome Web通知';不匹配的Senderid';错误_Google Chrome_Firebase_Firebase Cloud Messaging_Firebase Notifications - Fatal编程技术网

Google chrome Chrome Web通知';不匹配的Senderid';错误

Google chrome Chrome Web通知';不匹配的Senderid';错误,google-chrome,firebase,firebase-cloud-messaging,firebase-notifications,Google Chrome,Firebase,Firebase Cloud Messaging,Firebase Notifications,我已经部署了Chrome推送通知,并将gcm\u发送者\u id更新到新配置的项目中,客户端可以订阅/取消订阅而不会出现问题,但在发布发送通知的请求时,会不断返回响应mistchsenderid 我曾尝试创建多个新项目console.firebase.google.com,但似乎没有任何效果 请求: POST /gcm/send HTTP/1.1 Host: android.googleapis.com Authorization: key=<Server Key/> Content

我已经部署了Chrome推送通知,并将
gcm\u发送者\u id
更新到新配置的项目中,客户端可以订阅/取消订阅而不会出现问题,但在发布发送通知的请求时,会不断返回响应
mistchsenderid

我曾尝试创建多个新项目
console.firebase.google.com
,但似乎没有任何效果

请求:

POST /gcm/send HTTP/1.1
Host: android.googleapis.com
Authorization: key=<Server Key/>
Content-Type: application/json
{
    "registration_ids":[
        "<Registration-ID/>"
    ]
}

我使用“服务器密钥”作为请求身份验证令牌(使用无效密钥时返回401),并在清单中使用“发件人ID”:

manifest.json

{
  "name": "Notification Demo",
  "gcm_sender_id": "<Sender ID/>"
}
{
“名称”:“通知演示”,
“gcm\u发送方\u id”:”
}

这是我自己的错;示例注册ID的格式与我看到的生成ID的格式不同,并且不包含分号,我使用分号从订阅端点字符串中删除注册ID。通过正斜杠拆分端点并获取最后一个实例,返回了正确的注册ID,效果良好

{
  "name": "Notification Demo",
  "gcm_sender_id": "<Sender ID/>"
}