EasyAPNS: Has anybody tried it with large amounts of notifications?

落花浮王杯 提交于 2020-01-03 02:54:08

问题


I implemented EasyAPNS in my app and server and currently have a database with 2000+ registered devices.

Today I tried to send notifications to all of these devices and the script timed out. I checked the code (should've done it earlier, I know) and I discovered it opens a connection for each message.

Basically this thing will never work and will get my IP banned, right? How's it even possible that this problem is not mentioned anywhere in the Google group? Apparently nobody tried this library with a lot of notifications -- can this be real? Or am I missing something?


回答1:


I ended up rewriting a lot of the code that sends the messages to the APNS. Basically instead of looping through each message opening and closing the connection every time, just fetch N messages (probably the limit is 100) from the database every minute and send them in one shot. Do this until the messages table is empty (I used a cron job for this). I also had to do some more work because I needed multiple application support.

I'm not sure what the EasyAPNS guys were thinking when they wrote that library. Honestly, it didn't help at all -- it would have been better if I had written the APNS code from scratch on my own. Should anybody need help in modifying the library, just comment this post.




回答2:


APNS gets your IP blocked. I agree with pt2ph8.

One quick question, though to pt2ph8. Is it possible to create a library that will handle the APNS for multiple apps?



来源:https://stackoverflow.com/questions/5625480/easyapns-has-anybody-tried-it-with-large-amounts-of-notifications

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