Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

APN (Apple Push Notification) payload size limit

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:

enter image description here

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?

like image 793
Jakub Avatar asked Oct 07 '14 10:10

Jakub


People also ask

What is payload size of push notification?

The maximum size of the payload depends on the notification you are sending: 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)

How do I use Apple push notifications for APN?

Establish a Connection to APNs Use HTTP/2 and TLS 1.2 or later to establish a connection between your provider server and one of the following servers: Development server: api.sandbox.push.apple.com:443. Production server: api.push.apple.com:443.

Does Apple support push notifications?

Remote NotificationsCommunicate with Apple Push Notification service (APNs) and receive a unique device token that identifies your app. Use basic macOS command-line tools to send push notifications to Apple Push Notification service (APNs).


2 Answers

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)

like image 196
Xavier Maroñas Avatar answered Oct 07 '22 21:10

Xavier Maroñas


For iOS 9 there are some changes:

Introduction of HTTP/2
Payload increased to 4KB

4 KB limit apply to all versions of iOS and OS 10

Check this official link

  • 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)

  • 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)

Check this video link for more details regarding the features of HTTP/2
https://developer.apple.com/videos/play/wwdc2015-720/

like image 30
Rajan Maheshwari Avatar answered Oct 07 '22 22:10

Rajan Maheshwari