苹果推送通知:发送消息的高容量 [英] Apple Push Notification: Sending high volumes of messages

查看:118
本文介绍了苹果推送通知:发送消息的高容量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用PHP连接到APNS发送一些通知到多个设备,但问题是更概念化所以它并没有具体到PHP。
我将派遣约7000设备(和增长)都在同一时间。
我每天处理和广播ONCE运行到所有的设备,所以我不是不断地重新打开连接。

I am using PHP to connect to apns to send some notifications to multiple devices, although the question is more conceptual so it doesn't have to be specific to PHP. I will be sending to about 7000 devices (and growing) all at the same time. My process runs ONCE per day and broadcasts to all devices, so I am not constantly re-opening a connection.

目前我可以轻松地发送给两个设备在时间和消息将成功交付。
然而,当我尝试发送到全7000器件,这些消息似乎并没有提供。

Currently I can easily send to 2 devices at a time and the messages will successfully deliver. However when I attempt to send to the full 7000 devices, the messages do not seem to deliver.

的伪逻辑,我的code是:

The psuedo-logic to my code is:

open connection to apple
loop over devicetokens
    write to socket connection per device
end loop
close connection to apple.

我已经看到的地方,我应该只执行一个写,并构造一个庞大的身躯,换句话说psuedo- code看起来像:

I have seen somewhere that I should only perform a SINGLE write, and construct one huge body, in other words the psuedo-code would look like:

loop over device tokens
    create payload aggregating all devices
end loop
open connection to apple
write to socket ONCE with whole payload for 7000 devices
close connection

这是很难测试,因为我显然不能我的垃圾邮件生产7000用户测试消息。
有其他人有类似的问题?

It's difficult to test as I obviously can't spam my 7000 production users with test messages. Has anybody else had a similar problem?

感谢

推荐答案

我读过,苹果并约连接数护理您对自己的服务器,但我从来没有听说过任何有关写限制。此外,我不知道你会在这里得到什么样的反应,但也可能是值得一试,看看会发生什么。与沙箱推送通知服务器也许实验,只能使用生产设备的设备令牌。这些手机不能接收发往沙盒服务器,如果成功交付沙盒报告的推送通知,这将是一个无后顾之忧的方式来测试。

I've read that apple does care about the number of connections you make to their servers but I've never heard about any write limits. Also, I'm not sure about what kind of response you'd receive here, but it might be worth a try to see what happens. Maybe experiment with the sandbox push notification server, only using the device tokens of the production devices. Those phones should not receive any push notifications sent to the sandbox server and if the sandbox reports "delivered successfully", that would be a worry-free way to test.

这篇关于苹果推送通知:发送消息的高容量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆