【问题标题】:Firebase FCM HTTP legacy suddenly stop workingFirebase FCM HTTP legacy 突然停止工作
【发布时间】:2022-08-20 01:24:58
【问题描述】:

由于某些未知原因,在 3 周前,我突然无法向 Google Firebase FCM 发送通知。在此之前,它运行良好,在我向 FCM 推送内容后,所有客户端都可以正常接收通知。

我通过向https://fcm.googleapis.com/fcm/send 发出请求来做到这一点

标头为Content-Type: application/jsonAuthorization: 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


    【解决方案1】:

    我发现这可能是仅在 Firefox 中发生的错误。上面的代码在 Chrome 或 Edge 中仍然运行良好。

    也有这样的问题: FCM onMessage not working in Firefox, but working in chrome

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-09-27
      • 2017-08-22
      • 2021-02-01
      • 2016-12-29
      • 2018-05-09
      • 2015-12-07
      • 2015-08-23
      相关资源
      最近更新 更多