如何确定哪个设备未注册

时间:2017-06-06 15:33:30

标签: firebase firebase-cloud-messaging

如何确定哪个特定设备是“NotRegisterd”。

我向一些设备发送消息。我的身体在这里:

{
   "registration_ids": ["someCode1", "someCode2", "someCode3"],
   "notification": {...},
   "data": {...}
}

得到回应:

{
  "multicast_id": 6613705169343972705,
  "success": 1,
  "failure": 2,
  "canonical_ids": 0,
  "results": [
    {
      "error": "NotRegistered"
    },
    {
      "message_id": "0:1496749257460993%5fe3e4105fe3e410"
    },
    {
      "error": "NotRegistered"
    }]
}

如何确定哪些设备未注册? 我只有一个想法。 registration_ids的顺序是相同的结果顺序。

1 个答案:

答案 0 :(得分:0)

HTTP Server Protocol documentation的表5中,它将结果数组描述为:

  

表示已处理消息状态的对象数组。   对象以与请求相同的顺序列出(即,用于   请求中的每个注册ID,其结果都列在同一个中   响应中的索引)

所以你的猜测是正确的,结果的顺序与注册ID的顺序相同。

相关问题