Apple 推送通知在共享服务器上不起作用
我想从 PHP 脚本发送 APN(Apple 推送通知).我的 PHP 脚本工作正常,从 localhost 发送时,我也在 iphone 设备中收到通知,但是当我将具有相同 .pem 文件的相同脚本上传到 shared server
时,它返回错误...
I want to send APN (Apple Push Notification) from PHP script. My PHP script is working fine and I receive notification in the iphone device as well when sending from localhost but when I upload the same script with same .pem file to the shared server
it returns error...
Warning: stream_socket_client() [function.stream-socket-client]: unable to connect to ssl://gateway.push.apple.com:2195 (Connection refused) in /mypath/SendPushNotification.php on line 28 Failed to connect: 111 Connection refused
从某些来源我了解到,发送 APN 端口 2195 必须打开,这在共享服务器计划中是不可能的.所以我尝试使用专用服务器,它运行良好,我在设备上收到了通知.我努力寻找共享服务器的解决方案,但没有找到任何解决方案.
From some source I get to know that to send APN port 2195 must be open which is not possible in the shared server plan. So I tried using dedicated server and it's working perfectly and I receive the notification on the device. I tried hard to find the solution for shared server but didn't find any solution.
我的问题:是否可以在不打开共享服务器的 2195 端口的情况下发送 APN?如果是,请提供一些指导.
My question: is it possible send APN without opening port 2195 from shared server? if Yes give some guidance.
不,不能不使用 2195 端口发送 APN 消息.
No, Its not possible to send APN message without using 2195 port.
如果您想从共享服务器发送推送通知消息,请尝试使用一些第三方工具,例如http://urbanairship.com/.
If you want to send push notification message from shared server, try using some third party tools like http://urbanairship.com/.