apns icon indicating copy to clipboard operation
apns copied to clipboard

How to Batch send push

Open thues opened this issue 9 years ago • 6 comments

when we send to many devices with the same message, is there a method to make it called once ?

thues avatar Mar 16 '16 03:03 thues

No there is not.

If there was, some time could be saved encoding the message, but it would still need to be sent one-by-one to Apple, which is the bulk of the time.

nathany avatar Mar 16 '16 20:03 nathany

Actually i did it one by one , but there was another problem : If i send large number of msg, there will be many devices can not recv the push and there are little overdue tokens when i fetch feedback . How can i use this package to send batch pushes correctly

thues avatar Mar 17 '16 04:03 thues

If i send the push msg slowly i can get more invalid tokens than more fast push

thues avatar Mar 17 '16 11:03 thues

I'm not sure if I understand the problem you're running into. Is it disconnecting after invalid device tokens and causing problems? http://redth.codes/the-problem-with-apples-push-notification-ser/

This library attempts to handle those issues internally, but maybe you're still running into issues?

I've also been working on another library that uses Apple's new HTTP/2 Notification API, but it is currently slow when doing batch pushes. https://github.com/RobotsAndPencils/buford

nathany avatar Mar 17 '16 16:03 nathany

Thanks . Now i think i get the point . the problem is that the size of send Buffer(50) , gap of reconnect (1second), the push scale is 1000 pushes per second. If there are many invalid tokens, then it could not push all out successfully.

thues avatar Mar 18 '16 03:03 thues

Yah, perhaps that buffer should be larger.

nathany avatar Mar 18 '16 22:03 nathany