EasyAPNS:有人尝试过处理大量通知吗?

发布于 2024-10-31 18:38:42 字数 353 浏览 1 评论 0原文

我在我的应用程序和服务器中实现了 EasyAPNS,目前拥有一个包含 2000 多个注册设备的数据库。

今天,我尝试向所有这些设备发送通知,但脚本超时。我检查了代码(我知道应该早点完成),我发现它为每条消息打开一个连接。

基本上这个东西永远不会起作用并且会导致我的IP被禁止,对吧? Google 论坛中怎么可能没有提到这个问题?显然没有人尝试过这个带有大量通知的库——这是真的吗?或者我错过了什么?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

兰花执着 2024-11-07 18:38:42

我最终重写了很多将消息发送到 APNS 的代码。基本上,不必每次都循环打开和关闭连接的每条消息,只需每分钟从数据库中获取 N 条消息(可能限制为 100 条)并一次性发送它们。执行此操作,直到消息表为空(我为此使用了 cron 作业)。我还必须做更多的工作,因为我需要多个应用程序支持。

我不确定 EasyAPNS 的人在编写该库时在想什么。老实说,这根本没有帮助——如果我自己从头开始编写 APNS 代码会更好。如果有人需要帮助修改库,只需评论这篇文章。

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.

剩余の解释 2024-11-07 18:38:42

APNS 会阻止您的 IP。我同意 pt2ph8 的观点。

一个简单的问题,不过是问 pt2ph8。是否可以创建一个库来处理多个应用程序的 APNS?

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?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文