简体   繁体   English

华为PUSH套件旧令牌问题

[英]Problem with old tokens of Huawei PUSH kit

I am using the Huawei Push Toolkit to send push messages to customers.我正在使用华为推送工具包向客户发送推送消息。 There is a mechanism where the push tokens of each device are often refreshed, so a token used right now might be different than a token used, say, a day ago.有一种机制经常刷新每个设备的推送令牌,因此现在使用的令牌可能与一天前使用的令牌不同。

The issue was that if we try to send a push to a token that was valid only yesterday, the response is:问题是,如果我们尝试向仅在昨天有效的令牌发送推送,则响应为:

{ "code": "80000000" "msg": "Success", "requestId": "161615569495608835000107" } { "code": "80000000" "msg": "Success", "requestId": "161615569495608835000107" }

However, naturally, the device didn't receive the push because it was in the meantime refreshed.但是,设备自然没有收到推送,因为它正在刷新。 If sending it to the most up-to-date push token, the response is still the same and the device does get the message.如果将其发送到最新的推送令牌,则响应仍然相同,并且设备确实收到了消息。

Why didn't the API return a different response, say, the error code `80300007` (all tokens invalid) in the first scenario?为什么 API 在第一种情况下没有返回不同的响应,例如错误代码“80300007”(所有令牌都无效)? This is consistently replicated even for tokens older than 1 day (tested as far back as a 25 days old token).即使对于超过 1 天的代币(早在 25 天前的代币进行测试),这一点也始终如一地被复制。

reference 参考

The endpoints tested were: https://push-api.cloud.huawei.com/v2/.../messages:send测试的端点为: https://push-api.cloud.huawei.com/v2/.../messages:send

and https://push-api.cloud.huawei.com/v1/.../messages:sendhttps://push-api.cloud.huawei.com/v1/.../messages:send

Both have the same behavior.两者具有相同的行为。

The situation you experience with the device token is normal for the Push server and it is about the information flow and the return value is just a presentation of the current node.您使用设备令牌遇到的情况对于 Push 服务器来说是正常的,它是关于信息流的,返回值只是当前节点的表示。 To explain briefly 1. The Access Token is used only for the authentication interface.简单说明 1. Access Token 仅用于认证接口。 If the AT does not expire after the authentication succeeds, no error is reported.如果认证成功后AT没有过期,则不报错。 2. The server pushes messages through the Push interface. 2、服务器通过Push接口推送消息。 If success:80000000 is returned, the Huawei Push server has received the messages, but this does not mean that the messages can be pushed to the terminal.如果返回success:80000000,则说明华为Push服务器已经收到消息,但这并不代表可以将消息推送到终端。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM