APN(Apple 推送通知)有效负载大小限制 [英] APN (Apple Push Notification) payload size limit

查看:43
本文介绍了APN(Apple 推送通知)有效负载大小限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 说:

<块引用>

在 iOS 8 及更高版本中,通知允许的最大大小有效载荷为 2 KB;Apple 推送通知服务拒绝任何超过此限制的通知.(在 iOS 8 和 OS X 之前,最大负载大小为 256 字节.)

<小时>

根据更新的 Apple 文档 大小为 4KB.

  • 对于常规远程通知,最大大小为 4KB(4096 字节)
  • 对于互联网协议语音 (VoIP) 通知,最大大小为 5KB(5120 字节)注意
<块引用>

如果您使用旧版 APNs 二进制接口发送通知而不是 HTTP/2 请求,最大负载大小是 2KB(2048 字节)

In official documentation you can find the info:

Each push notification includes a payload. The payload contains information about how the system should alert the user as well as any custom data you provide. The maximum size allowed for a notification payload is 256 bytes; Apple Push Notification Service refuses any notification that exceeds this limit.

However in WWDC 14 we can see this screenshot:

I wonder if there is any official Apple statement about the size limit of push notification. I tested it and larger that 256 bytes works, but documentation said it shouldn't. Can someone confirm or deny the size of remote notifications?

解决方案

Apple has already updated the documentation. The 2KB for the maximum payload size is just for devices running iOS 8. The official doc says:

In iOS 8 and later, the maximum size allowed for a notification payload is 2 kilobytes; Apple Push Notification service refuses any notification that exceeds this limit. (Prior to iOS 8 and in OS X, the maximum payload size is 256 bytes.)


As per the updated Apple docs the size is 4KB.

  • For regular remote notifications, the maximum size is 4KB (4096 bytes)
  • For Voice over Internet Protocol (VoIP) notifications, the maximum size is 5KB (5120 bytes) NOTE

If you are using the legacy APNs binary interface to send notifications instead of an HTTP/2 request, the maximum payload size is 2KB (2048 bytes)

这篇关于APN(Apple 推送通知)有效负载大小限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆