使用Google API接收Firebase主题消息的状态 [英] Firebase Topic Message Received Status using Google API
问题描述
想知道有多少用户正在交付和失败。因为如果有些用户没有交付和失败,我会重新设置通知重试给那些成员。任何想法吗?
我也通过ARC(高级休息客户端)尝试了下面的URL,以获取我当前项目中所有主题的信息,包括以下API: / p>
https://iid.googleapis.com/iid/info/APA91bHQ3Jp2NPrVF7z_1a8qNgg_YGI-
zPhnxnpumCeckvieHACuwaIWPlaR .... QcChUOhk4T62vAc_0PC8HVk4p4D? details = true
Content-Type:application / json
Authorization:key =< SERVER_KEY>
SERVER_KEY - >(Firebase Console - > Settings - > Cloude message - > Legacy Server key)
但是我得到了响应状态:
400:Bad Request
{
error:InvalidTokenVersion
}
想解决这个问题吗?
目前没有可用的API来跟踪消息是否已被当使用Topics Messaging时,设备会收到这个消息。
您必须以某种方式实现您自己的方式确认被收到你的客户端应用程序,如果它没有收到它,然后让你的应用程序服务器重试。
在一个侧面说明,当使用FCM,它是强烈建议使用服务器密钥而不是传统的服务器密钥。
关心 InvalidTokenVersion
响应。它似乎与注册令牌有关。我试了一下,并能够复制响应,但只有当使用旧格式的注册令牌(以 APA
不带冒号)<$ c
但是当我用新格式测试一个标记时,它返回了预期的响应。我相当肯定这与注册令牌有关。
Recently, I integrated the Firebase Topic concept in my APP and near to 2K users was subscribed and I', triggering notifications daily via my app server.
What I want to know is how many users are getting delivered and failed. Because if some users are not getting delivered and failed, I'll set a retry of the notification to those members again. Any ideas about this?
I also tried the following URL via ARC (Advanced Rest Client) for getting the information about all my topics in my current project with following API:
https://iid.googleapis.com/iid/info/APA91bHQ3Jp2NPrVF7z_1a8qNgg_YGI-
zPhnxnpumCeckvieHACuwaIWPlaR....QcChUOhk4T62vAc_0PC8HVk4p4D?details=true
Content-Type: application/json
Authorization: key=<SERVER_KEY>
SERVER_KEY -> ( Firebase Console -> Settings -> Cloude message -> Legacy Server key )
But I am getting the response status:
400: Bad Request
{
"error": "InvalidTokenVersion"
}
Any idea to resolve this issue?
There is currently no available API that you can use in order to trace if a message has been received by the device when using Topics Messaging.
You'll have to implement your own way to somehow acknowledge that the message from the topic has been received by your client app, if it didn't receive it, then have your App Server do a retry.
On a side note, when using FCM, it is highly advised to make use of the Server Key instead of the Legacy Server Key.
With regards to the InvalidTokenVersion
response. It seems that it is related to the registration token. I tried it out on my end and was able to replicate the response, but only when using a registration token with the old format (starts with APA
with no colon ":
").
But when I tested a token with the new format, it returned expected response. I'm fairly sure this has something to do with the registration token somehow.
这篇关于使用Google API接收Firebase主题消息的状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!