iphone - iOS:一次请求可以发送多少条推送通知?

标签 iphone ios push-notification apple-push-notifications

我正在使用 APNS python 包装器库发送推送通知。 Apple 文档说消息的有效负载限制为 256 字节。但是由于一个请求可以发送多个PN,我想知道同一个请求中允许的消息数量是否有限制?

发送大量(1000+)推送通知的正确方法是什么? Apple 服务器是否限制连接数/秒或 PN/秒以避免垃圾邮件?

最佳答案

正如 Jonathan 在他的评论中所说,Apple 没有在 APNS 文档中指定限制。

由于您通过 TCP 连接将通知作为二进制数据发送,因此在单个请求中发送的通知数量取决于 TCP 缓冲区的大小。

您不必为每个请求发送一个通知。我不确定在这种情况下单个请求一词是否有意义(因为它们不会为发送的每个通知返回响应)。 Apple 鼓励您尽可能长时间保持连接打开。只要它是打开的,你可以写任意多的字节(属于多个推送通知)。

编辑:

Apple 最近编辑了他们的 technical note regarding push notifications :

Push Notification Throughput and Error Checking

There are no caps or batch size limits for using APNs. The iOS 6.1 press release stated that APNs has sent over 4 trillion push notifications since it was established. It was announced at WWDC 2012 that APNs is sending 7 billion notifications daily.

If you're seeing throughput lower than 9,000 notifications per second, your server might benefit from improved error handling logic.

关于iphone - iOS:一次请求可以发送多少条推送通知?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15601243/

相关文章:

c# - 将通知模板从应用程序后端注册到 Azure 通知中心

android - 当应用程序关闭或未运行时,Android 上的 Cordova 推送插件无法工作

iphone - 为什么我的 iPhone 应用程序崩溃并出现异常 "Could not load NIB in bundle"?

iphone - 在设备上解压文件

iOS swift : How to hide and reveal a button in UIViewController

iOS 应用程序不会更改为 RTL 语言

ios - 在应用内启用或禁用 Iphone 推送通知

iphone - 如何在 UiTextView 中输入多色文本?

ios - 从 "bouncing"垂直停止 UIWebView?

iPhone : How to get colour of each pixel of an image?