Reputation: 3824
I'm using APNS python wrapper library to send push notifications. Apple docs say payload limit on a message is 256 bytes. But since multiple PNs can be sent in one request, I wanted to know if there is a limit to the number of messages allowed in the same request?
What is the correct way of sending lots (1000+) of push notifications? Does Apple server limit connections/sec or PNs/sec to avoid spam?
Upvotes: 13
Views: 14064
Reputation: 394146
As Jonathan said in his comment, Apple doesn't specify a limit in the APNS documentation.
Since you send the notifications as binary data over a TCP connection, the number of notifications that would be sent in a single request depends on the size of your TCP buffers.
You don't have to send one notification per request. I'm not sure there's even a meaning to the term single request in this case (since they don't return a response for each notification sent). Apple encourages you to keep the connection open as long as possible. As long as it is open, you can write as many bytes (belonging to multiple push notifications) as you wish.
EDIT :
Apple recently edited their 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.
Upvotes: 11