假设我有 3 个通知要发送 - a
、b
和 c
- 但是通知 b 有问题
。让我们假设它是一个无效的 token 。如果我执行以下操作:
- 创建缓冲区
- 将a、b、c添加到缓冲区
- 发送缓冲区到 APNS 服务器
是否会发送消息c
?
Apple 文档说:
If you send a notification and APNs finds the notification malformed or otherwise unintelligible, it returns an error-response packet prior to disconnecting.
这是否意味着我会收到关于 b
的错误并且连接会被断开,因此永远不会发送 c
?
最佳答案
消息 c
永远不会被发送。如果您设法收到消息 b
的错误响应,则必须重新发送发送 b
之后和收到响应之前发送的所有消息。
你可以在这里阅读一篇关于它的好文章:The Problem with APNS
关于iphone - 向 APNS 批量发送消息,如果其中一些出现错误怎么办?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10848970/