【问题标题】:How do I fix the problem behind "THIRD_PARTY_AUTH_ERROR" when using Google's API Explorer to send a Firebase Cloud Messaging message?使用 Google\'s API Explorer 发送 Firebase 云消息传递消息时,如何解决 \"THIRD_PARTY_AUTH_ERROR\" 背后的问题?
【发布时间】:2022-08-13 01:15:45
【问题描述】:

我正在尝试创建一个非常简单的 Web 应用程序,它可以通过 Firebase Cloud Messaging 发送和接收消息(包括推送通知)。我想尝试测试接收从 Google API Explorer 发送的测试消息的能力。但是,我遇到了一个奇怪的错误,因为来自the relevant API URL 的任何 API 调用都会返回以下错误:

{
  \"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\"
      }
    ]
  }
}

作为参考,这是我要发送的消息:

{
  \"message\": {
    \"token\": \"[FCM_TOKEN]\",
    \"notification\": {
      \"title\": \"New Notification\",
      \"body\": \"Sample Text\"
    }
  }
}

我还注意到,当我在消息中添加\"validate_only\": true 时,错误消失并且发送请求成功(尽管这没有帮助,因为这会禁用实际发送消息)。

我很难过,因为弹出的提示表明我的 OAuth2 凭据无效,尽管我保留了 OAuth2 凭据选项并通过授权弹出窗口提供我的凭据。

    标签: firebase-cloud-messaging google-apis-explorer


    【解决方案1】:

    您是否在 Firefox 上运行 Web 应用程序? 几天来,我一直在为同样的问题奔波,今天我发现 Firefox 存在问题,而这在 Chrome 上确实有效: Similar stack overflow question The issue on the Firebase repository on Github

    虽然不是一个正确的答案,但我希望这会有所帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-12-02
      • 2017-02-07
      • 2020-03-15
      • 1970-01-01
      • 2017-04-05
      • 2020-02-26
      • 2019-12-30
      相关资源
      最近更新 更多