【问题标题】:How to see number of recipients for FCM如何查看 FCM 的收件人数量
【发布时间】:2017-03-26 16:14:38
【问题描述】:

我使用以下 json 数据向https://fcm.googleapis.com/fcm/send 发出请求:

{
    "to": "/topics/push_topic",

    "data" : {
        "language": "tr,en_us",
        "ticker": "...",
        "tickerEnglish": "...",
        "body": "...",
    }
}

我收到的回复如下(消息发送成功):

{
    "message_id": xxxxxxxxxxxxx
}

但根据文档,我应该会收到如下回复:

{
    "multicast_id": 216,
    "success": 3,
    "failure": 3,
    "canonical_ids": 1,
    "results": [
        { "message_id": "1:0408" },
        { "error": "Unavailable" },
        { "error": "InvalidRegistration" },
        { "message_id": "1:1516" },
        { "message_id": "1:2342", "registration_id": "32" },
        { "error": "NotRegistered"}
     ]
}    

那么,为什么我在回复中看不到成功和失败变量?那是因为我将消息发送到某个主题吗?

谢谢。

【问题讨论】:

    标签: android firebase push-notification firebase-cloud-messaging


    【解决方案1】:

    这是发送到topic 时的预期响应。

    具有多个结果的示例响应适用于您在发送消息负载时使用registration_ids 参数。

    【讨论】:

    • @bigO 非常确定文档显示了我上面所说的内容。您能指出您所指的文档吗?
    • 感谢您的回答。所以看起来没有办法看到有多少人收到了这条消息,有多少人读对了?我指的是文档的这一部分:firebase.google.com/docs/cloud-messaging/server#response
    • 在使用主题时不会。如果您在发送消息时使用了注册令牌(to 用于单个令牌,registration_ids 用于多个),您可以使用Diagnostics and Statistics page 来查看是否成功发送到设备。对于“有多少人阅读它”部分,我想你可以实现Delivery Receipts
    • 是的。该文档指的是使用registration_ids 来获取该格式的响应。
    猜你喜欢
    • 1970-01-01
    • 2013-09-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-12-21
    • 2015-11-07
    相关资源
    最近更新 更多