华为推送 API 抛出错误,表示邮递员中的令牌计数错误

Huawei push API throws error saying token count is wrong in postman

连续使用推送 API returns 令牌计数应在 1 到 1,000 之间。请在屏幕截图中找到 API 错误。

出现此问题的可能原因是,您将“token”属性放置在错误的位置。

解决方法: 请将您的“令牌”属性保留在“消息”对象中。 enter image description here

详情请查看以下文档:

https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/android-server-dev-0000001050040110

您的令牌在邮件正文之外,“令牌”、“android”应该在邮件正文之内。

请检查示例代码here

另外,如果你想使用更多的令牌(>1000),最好的方法是使用应用服务器调用API并批量发送消息。