gpt4 book ai didi

android - Firebase 云消息传递 - 响应 JSON 中的 "success"和 "failure"

转载 作者:太空宇宙 更新时间:2023-11-03 12:47:49 24 4
gpt4 key购买 nike

我使用 Firebase Cloud Messaging 向我的 Android 客户端应用程序发送通知,每个通知都应该根据其注册 token 发送到单个设备。

每次我通过 https://fcm.googleapis.com/fcm/send 发送通知,我收到了一个像这样的 JSON 响应:

{
"multicast_id": 108,
"success": 1,
"failure": 0,
"canonical_ids": 0,
"results": [
{ "message_id": "1:08" }
]
}

我发现 successfailure 是多余的——它们不是同一个意思吗?我应该检查它们以确保一切正常吗? success != failure 总是正确的吗?

最佳答案

如所述here :

success - Required, number of messages that were processed without an error.

failure - Required, number of messages that could not be processed.

你得到:"success": 1,表示成功处理了1条消息"failure": 0,表示没有错误

关于android - Firebase 云消息传递 - 响应 JSON 中的 "success"和 "failure",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39015880/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com