什么是来自 https://web.push.apple.com 的 BadWebPushTopic 的原因?

huangapple go评论41阅读模式
英文:

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.

huangapple
  • 本文由 发表于 2023年3月9日 22:21:03
  • 转载请务必保留本文链接:https://go.coder-hub.com/75685856.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定