Apple 推送通知在共享服务器上不起作用 [英] Apple Push Notification not working on shared server

查看:26
本文介绍了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/.

这篇关于Apple 推送通知在共享服务器上不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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