Vir*_*ana 5 iphone apple-push-notifications ipad ios apns-php
我已经从这个Apns代码完成了php和Objective c的apns代码
并从此链接设置证书
用于向ios设备发送通知的沙箱和生产apns在我的服务器上运行完美.我将代码和相同的证书移动到客户端服务器,然后发送通知不起作用.
我调试所有的PHP代码,发现它停在这行代码
private function _connectSSLSocket($development) {
$ctx = stream_context_create();
stream_context_set_option($ctx, 'ssl', 'local_cert', $this->apnsData[$development]['certificate']);
$this->sslStreams[$development] = stream_socket_client($this->apnsData[$development]['ssl'], $error, $errorString, 100, (STREAM_CLIENT_CONNECT|STREAM_CLIENT_PERSISTENT), $ctx);
if(!$this->sslStreams[$development]){
$this->_triggerError("Failed to connect to APNS: {$error} {$errorString}.");
unset($this->sslStreams[$development]);
return false;
}
return $this->sslStreams[$development];
}
Run Code Online (Sandbox Code Playgroud)
apns.log文件显示错误"无法连接到APNS:110连接超时".
没有弄错.为什么我会收到此错误而不向ios设备发送通知?任何人都可以指导我吗?
| 归档时间: |
|
| 查看次数: |
6156 次 |
| 最近记录: |