Send multiple Iphone notification through APNS without looping

1.9k Views Asked by At

I write web services for android and iphone apps in php. Recently in an app I had to send lots of Push notifications(around a few thousand) and realized the only good APNS method available on net by Ray Wenderlich was no more feasible for my purpose.
So I tried to find if there is a way through which I can group multiple device tokens in an array and send all the notifications at once which is quite possible in case of Android's Google Cloud Messaging Service. In it I can group up to 1000 device tokens at once and send them notification at once.
Notification payload remains the same so grouping device token isn't an issue. All I could get was method to loop through the device tokens and send each notification which is no more feasible.
Kindly help me with this. In short I do not want to loop through each token and send individual request. There are 100 questions on stackoverflow and 100 answers but each one uses looping individual token.

1

There are 1 best solutions below

0
On

You can't send to Apple Push Notification Service a single request with multiple device tokens. Their binary format simply does not support this. You will have to send an individual request for each token. If you send all the requests in a single connection, TCP will batch them together for you, which will improve performance. However, there is no way to avoid sending the same payload for each of the device tokens.