英文:
What is the cause of BadWebPushTopic from https://web.push.apple.com?
问题
我从苹果的 WebPush API https://web.push.apple.com/...
不定期收到响应 {"reason":"BadWebPushTopic"}
,响应代码为 400。如果我稍后使用相同的 Topic
发送相同的消息,它就能正常工作。
我的 Topic
标头始终为包含 0-9 和 a-z 的 25 个字符。
有关如何处理此错误的建议吗?
英文:
I receive sporadic from the Apple webpush API https://web.push.apple.com/...
the response {"reason":"BadWebPushTopic"}
with response code 400 . If I send the same message with the same Topic
later it work without problems.
My Topic
header has always 25 characters with 0-9 and a-z.
Any suggestion how to handle this error?
答案1
得分: 4
经过许多测试,似乎主题大小与4的因子相匹配。听起来苹果服务器试图将其解码为base64。我已经用0
填充了32个字符,这是主题的最大尺寸。
英文:
After many tests, it seems that the topic size works with a factor of 4. Sounds like the Apple server try to decode it as base64. I have fill it with 0
to 32 characters, which is the max size for the topic.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论