服务器端 iPhone APNS 通信
我有一个快速的问题。 对于苹果推送通知服务,我需要有自己的服务器,它将向苹果服务器发送推送通知,对吧?
我可以在常规虚拟主机帐户上使用简单的 PHP 脚本来执行此操作吗?或者我是否需要具有完整管理访问权限的专用服务器?
如果这在 PHP 中是可能的,任何人都可以向我指出一些可以帮助我开始这一点的示例吗? 现在,我非常有信心在实现客户端部分时不会遇到麻烦,但服务器端对我来说仍然有些神秘......
谢谢!
弗洛里安
I have a quick question. For the apple push notification service, I need to have my own server, which will send out the push notifications to the apple servers, right?
Can I do this with a simple PHP script on a regular webhosting account, or do I need a dedicated server with full blown admin access for that?
If this is possible in PHP, can anyone point me to some samples that can help me get started on this? Right now, I am pretty confident I won't have trouble implementing the client-side part, but the server side is still somewhat of a mystery to me...
Thank you!
Florian
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
只要您可以在大部分时间保持与服务器的连接打开,您就可以在有限的托管帐户上执行此操作。 一些示例代码:
http://code.google.com/p/php-apns/< /a>
另请注意,一些公司正在启动服务来专门帮助您进行推送托管(我将保持帖子中立,不提及名称,我不确定哪些服务正在运行)。
You probably will be able to do this on a limited hosting account, as long as you can leave the connection open to the server most of the time. Some sample code:
http://code.google.com/p/php-apns/
Note also that some companies are starting up services to help you specifically with push hosting (I'll keep the post neutral and not mention names, I'm not sure which services are running just yet).
APNS 的主要问题是端口,
因此许多提供商不打开 2195 端口
,因此一开始就集中精力,然后去找主机提供商
这是我尝试过的代码,但有一个问题是无法获取设备通知
嗨,
我尝试了以下代码(PHP)
回复已建立连接
正在发送消息 :�� d^÷Îå0ZCd%1äuwOOYš'ÊÈ}ârðm⁄Í�,{"aps":{"\u2019alert\u2019":"测试消息"}}
发送有效负载:{“aps”:{“\u2019alert\u2019”:“测试消息”}}
但无法获得通知
任何帮助?
The Main problem with APNS is ports
so many providers doesnt open 2195 port
so concentrate on that initially then go for the host provider
Here is the code what i tried, but one problem is not able to get device notification
Hi ,
i tried the following code (PHP)
reply is Connection Established
sending message :�� d^÷Îå0ZCd%1ÄuwOOYš'ÊÈ}ârðm¾Í�,{"aps":{"\u2019alert\u2019":"test message"}}
sending payload :{"aps":{"\u2019alert\u2019":"test message"}}
But am not able to get the notification
any help?