firebase-如何知道哪个registration_id错误/已过期/已删除 [英] firebase - How to know which registration_id is bad/expired/deleted
问题描述
因此,我正在将通知批量推送到多个设备.如果它们不在Firebase中,我想从我的数据库中删除设备GFCM令牌.
So I am pushining notifications in a batch to multiple devices. I want to delete device GFCM tokens from my databse if they are not in firebase.
测试请求:
<代码> { registration_ids":[ fznIum-OIL0:APA91bE9n6gxqVEB3hR0On_TZqH_cOOO7rFyLE5MYbvKXUX3737IonXquZRoHeY1UJf20G4nrahz35p80X8PAPouviYvXgtekAzeDFuwaWyiPI1sFlN1d1wGp5OulXv9wUzHyegeZiih", dsasadadsasdasdasdasdefs", fjb0qTB9ACI:APA91bHvx0pSlq-NuQz-bU70DhL7BXAcd-DqT9YT0ZjYw7R_pkBmr8oe6XdNw8IPlU67d-rXMfRY3mybaO7K5GHo_NH7G-Ya1Ae2xxJP1JIbuuSYomz31y_MPQijFK8w-bZXQ26SWE09"],通知":{"body":您收到来自Alice的新消息"}}
响应:
{
"multicast_id": 7971310728176484096,
"success": 1,
"failure": 2,
"canonical_ids": 0,
"results": [
{
"error": "NotRegistered"
},
{
"error": "InvalidRegistration"
},
{
"message_id": "0:1481547993513035%4f9c20964f9c2096"
}
]
}
如何检测哪些registration_id是错误的/未注册?
How to detect which registration_ids are bad/Not registered?
谢谢!
推荐答案
Okey,我想我知道了.
Okey, i think i figured it out.
结果":按照您在registration_ids中指定的顺序返回响应/错误
"results": Returns responses/errors in the order you specified it in registration_ids
这篇关于firebase-如何知道哪个registration_id错误/已过期/已删除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!