Max number of devices to send to APNS socket sever

馋奶兔 提交于 2019-12-04 09:57:21

The problem wasn't the number of devices to sent to APNS. The problem turned out to be that Apple changed their API. You now need to check every single device to see if it's still valid (ie. if they are denying push notificaitons, if the device deleted the app, etc.). If the device no longer accepts push notifications from your app and you send one to it anyways, Apple immediately drops the connection to your APNS socket. I now have a cronjob that runs a program once a day that checks and deletes any devices from my database that no longer accept push notifications (Apple has this list). But be careful -- once you pull the list of disabled device ids from Apple, Apple deletes it from their server and you can never pull it again.

You also need to update your push notification code to check if the connection is ever dropped. When the connection is dropped, the program needs to reestablish the connection and try to push again.

Indeed, based on experience, it seems that connections to APNS will fail after some number of notifications have been pushed through it. In our own APNS library (http://code.google.com/p/javapns/), the multithreaded transmission engine included in the library automatically restarts connections after pushing 200 notifications (seems to be a magic number after trial and error). Since we introduced that feature (along with some other minor comlink recovery options), the failed notification rate for large amounts of notifications went to zero.

Same problem.. It looks like a limit of 2000 devices is the maximum. So, 2000 (or less) tokens by socket opened. Try and see !

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!