【发布时间】:2022-08-20 01:24:58
【问题描述】:
由于某些未知原因,在 3 周前,我突然无法向 Google Firebase FCM 发送通知。在此之前,它运行良好,在我向 FCM 推送内容后,所有客户端都可以正常接收通知。
我通过向https://fcm.googleapis.com/fcm/send 发出请求来做到这一点
标头为Content-Type: application/json、Authorization: key=AAAAKFe-...oRpS。密钥来自此链接中喜欢的设置image
身体喜欢这个
{
\"to\": \"dmx5JJ...dnPb7\",
\"data\": {
\"title\": \"title\",
\"alertId\": 1276318267,
\"alertMappingId\": 1238716233,
\"data\": \"hehehe\"
}
}
与 \"to\" 是 idToken 从 Web 客户端检索。
谷歌返回成功 HTTP 响应,但其内容是 AuthenticationError:
{\"multicast_id\":5347538896185294090,\"success\":0,\"failure\":1,\"canonical_ids\":0,\"results\":[{\"error\":\"AuthenticationError\"}]}
我犯了什么错误吗?还是 Google Firebase 只是更改了一些政策?有人请帮我解决这个问题:\'(
PS:我尝试切换到 HTTP v1,但仍然得到类似的结果 :\'(
{
\"error\": {
\"code\": 401,
\"message\": \"Auth error from APNS or Web Push Service\",
\"status\": \"UNAUTHENTICATED\",
\"details\": [{
\"@type\": \"type.googleapis.com/google.firebase.fcm.v1.FcmError\",
\"errorCode\": \"THIRD_PARTY_AUTH_ERROR\"
}]
}
}
标签: firebase firebase-authentication firebase-cloud-messaging