timehop / apns

A Go package to interface with the Apple Push Notification Service
https://godoc.org/github.com/timehop/apns
MIT License
185 stars 47 forks source link

How to Batch send push #70

Open thues opened 8 years ago

thues commented 8 years ago

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

nathany commented 8 years ago

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.

thues commented 8 years ago

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 commented 8 years ago

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

nathany commented 8 years ago

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

thues commented 8 years ago

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.

nathany commented 8 years ago

Yah, perhaps that buffer should be larger.