在我们的项目中,我们使用Firebase云消息传递推送通知,我们遇到了消息重复的问题。我们的过程如下:
Xamarin.Firebase.iOS.CloudMessaging 3.1.2
Xamarin.Firebase.iOS.InstanceID 3.2.1
Xamarin.Firebase.iOS.Core 5.1.3
当用户登录应用程序请求时,token
订阅主题reuqest的用户
POST https://iid.googleapis.com/iid/v1:batchAdd
request body
{
"to" : "/topics/test",
"registration_tokens" : ["..user_registration_token.."]
}
发送通知。
发送主题订阅者请求的通知
POST https://fcm.googleapis.com/v1/projects/our_project_id/messages:send
request body
{
"message":
{
"topic":"test",
"notification":
{
"title":"test-6",
"body":"test-6"
}
}
}
执行取消订阅用户令牌的操作。
POST https://iid.googleapis.com/iid/v1:batchRemove
{
"to": "/topics/test",
"registration_tokens" : ["..user_registration_token.."]
}
但是,当用户再次登录并请求全新的令牌时,设备仍然收到发送到旧令牌的推送通知,如果按主题发送通知,这些用户将收到重复推送通知。
如果我们尝试从api方法获取旧令牌的信息
GET https://iid.googleapis.com/iid/info/token.....
我们得到回应
<HTML>
<HEAD>
<TITLE>Internal Server Error</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Internal Server Error</H1>
<H2>Error 500</H2>
</BODY>
</HTML>
发布于 2020-06-30 12:59:27
尝试将?details=true添加到uri中。确保在标题中使用授权键。预期产量是
{“错误”:“没有找到有关此实例id的信息”}
或
{
"application": "com.chrome.windows",
"subtype": "wp:http://localhost:8089/#xxx-xx-xx-xx-xx-x",
"scope": "*",
"authorizedEntity": "xxxx",
"rel": {
"topics": {
}
}
},
"platform": "BROWSER"
}
https://stackoverflow.com/questions/58949622
复制相似问题