Firebase 意外 JSON 设备离线时的响应
Firebase Unexpected JSON Response when device is offline
我正在使用 HTTP 服务器,这是我通过 firebase 服务器发送的消息
$fcm = array
(
'to' => $stored_token,
'priority' => 'high',
'time_to_live' => 0,
'data' => array
(
'msg' => 0
)
);
time_to_live为0,表示应该立即发送或丢弃,表示设备离线时应该获取
error:Unavailable
但这是来自 FCM 服务器的服务器:
{
"multicast_id": 7.0206465789357e+18,
"success": 1,
"failure": 0,
"canonical_ids": 0,
"results": [
{
"message_id": "0:1472135754209293%d42090b5f9fd7ecd"
}
]
}
正在以高优先级发送消息,时间为 live:0 秒,设备处于离线状态。
为什么会这样?
Table FCM HTTP 服务器协议 documentation 中的 5 表示响应中的 failure
计数是
Number of messages that could not be processed
处理失败的原因详见Table 9.所有原因都与请求参数有问题有关,比如格式不合法,值缺失等,你的请求是有效的,也是有效的算作成功。
在你的 post 中,你说 "This behavior is against as stated in the documents"。请更新您的 post 以在文档中包含一个 link,说明交付失败应计为处理失败。
我正在使用 HTTP 服务器,这是我通过 firebase 服务器发送的消息
$fcm = array
(
'to' => $stored_token,
'priority' => 'high',
'time_to_live' => 0,
'data' => array
(
'msg' => 0
)
);
time_to_live为0,表示应该立即发送或丢弃,表示设备离线时应该获取
error:Unavailable
但这是来自 FCM 服务器的服务器:
{ "multicast_id": 7.0206465789357e+18, "success": 1, "failure": 0, "canonical_ids": 0, "results": [ { "message_id": "0:1472135754209293%d42090b5f9fd7ecd" } ] }
正在以高优先级发送消息,时间为 live:0 秒,设备处于离线状态。
为什么会这样?
Table FCM HTTP 服务器协议 documentation 中的 5 表示响应中的 failure
计数是
Number of messages that could not be processed
处理失败的原因详见Table 9.所有原因都与请求参数有问题有关,比如格式不合法,值缺失等,你的请求是有效的,也是有效的算作成功。
在你的 post 中,你说 "This behavior is against as stated in the documents"。请更新您的 post 以在文档中包含一个 link,说明交付失败应计为处理失败。