edamov/pushok

Max. number of token to send notification to?

baden32 opened this issue · 3 comments

In the sample code, we can see
$deviceTokens = ['<device_token_1>', '<device_token_2>', '<device_token_3>'];

At this time, for me it works fine for 3 tokens, all devices received the message.

So my question: is there a max. number of token I can send the notification at the same time?

If I have 4000 receivers, coud I add my 4000 tokens at a time and then call the push function or should I split into smallest packages (ie 1000 receivers)?

Thank you in advance for your help.
Regards
Joe

I didn't try to send so many notifications so I can't say for sure

yosus commented

Yes, you can put in thousands of tokens into the request.

Just to share some stats that I have after using this library. The old binary-method (sending to gateway.push.apple.com) which may/will be discontinued by Apple on 31-Mar-2021, is still the fastest way.

Sent using Amazon EC2 T3.small server with ssl-verification turned off.

Seconds Token Count Seconds / 1000 token-count Remarks
20.00855127 2224 8.996650749  
119.7289643 12421 9.63923712  
10.31108534 1104 9.339751216  
85.24094299 8918 9.558302645  
10.16839604 1091 9.320253019  
188.0041651 21137 8.894552922 Completed time 19:22:17
261.361829 21134 12.36688885 Completed time 19:20:31
227.3990977 21139 10.75732521 Completed time 19:03:58

*note : Note the time, thus affecting the speed.

Great thank you for your complete info and answer, great help.
Regards