相关疑难解决方法(0)

对于未注册的令牌,FCM HTTP V1 API返回404

当设备未注册(应用程序已卸载)时,FCM HTTP v1 API应返回错误代码"UNREGISTERED".但是,API返回404"未找到请求的实体".

有没有人经历过这个?这是预期的吗?在文档中的任何地方都没有提到这一点.

当404错误并收到"未找到请求的实体"消息时,假设设备未注册是否安全?

以下是收到的错误的全部内容.

{
  "error": {
    "code": 404,
    "message": "Requested entity was not found.",
    "errors": [
      {
        "message": "Requested entity was not found.",
        "domain": "global",
        "reason": "notFound"
      }
    ],
    "status": "NOT_FOUND"
  }
}
Run Code Online (Sandbox Code Playgroud)

例外:

Caused by: com.google.firebase.messaging.FirebaseMessagingException: Requested entity was not found.
    at com.google.firebase.messaging.FirebaseMessaging.handleSendHttpError(FirebaseMessaging.java:266) ~[firebase-admin-5.9.0.jar:?]
Run Code Online (Sandbox Code Playgroud)

有关参考API文档:

https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages https://firebase.google.com/docs/reference/fcm/rest/v1/ErrorCode

google-cloud-messaging firebase-cloud-messaging

19
推荐指数
1
解决办法
1万
查看次数