测试苹果推送通知服务
我在我的服务器上尝试了“easy-ASPN”http://www.easyapns.com..
这是php连接苹果服务器的代码:
$ctx = stream_context_create();
stream_context_set_option($ctx, 'ssl', 'local_cert', 'apns.pem');
$fp = stream_socket_client('ssl://gateway.push.apple.com:2195', $error, $errorString, 100, (STREAM_CLIENT_CONNECT|STREAM_CLIENT_PERSISTENT), $ctx);
我确保在php配置中启用了openssl..
服务器管理员告诉我他打开了端口:2196, 2196,
但是这个php代码总是返回:
Failed to connect to APNS: 110 Connection timed out.
我尝试从shell测试与苹果服务器的连接,
我已经写道:
telnet gateway.sandbox.push.apple.com 2195
但它返回:
-bash: telnet: command not found
我真的不知道如何解决这个问题......
i tried "easy-ASPN" http://www.easyapns.com on my server..
this is the php code for connecting apple server:
$ctx = stream_context_create();
stream_context_set_option($ctx, 'ssl', 'local_cert', 'apns.pem');
$fp = stream_socket_client('ssl://gateway.push.apple.com:2195', $error, $errorString, 100, (STREAM_CLIENT_CONNECT|STREAM_CLIENT_PERSISTENT), $ctx);
i am ensure that openssl is enabled in php configuration..
server administrator told me thad he opened ports: 2196, 2196
but this php code always returns:
Failed to connect to APNS: 110 Connection timed out.
i tried to test the connection to apple server from the shell,
i have wrote:
telnet gateway.sandbox.push.apple.com 2195
but it returned:
-bash: telnet: command not found
i am really don't know how to solve this problem...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现有两件事可能会导致您的问题。首先,您需要发送密码:
此外,您应该点击反馈 URL:
(URL 的沙箱部分用于开发,如果您点击产品实例,请将其删除)
希望有所帮助。
I see two things that could be causing your problem. First you need to send your passphrase:
Also, you should be hitting the feedback URL:
(the sandbox part of the URL is for dev, remove it if you are hitting your prod instance)
Hope that helps.