gpt4 book ai didi

iphone - Apns 错误 "Failed to connect to APNS: 110 Connection timed out."

转载 作者:可可西里 更新时间:2023-11-01 04:41:55 29 4
gpt4 key购买 nike

我已经从这个 Apns code 为 php 和 objective-c 完成了 apns 代码

并从 this link 设置证书

用于向 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];
}

apns.log 文件显示错误“无法连接到 APNS:110 连接超时。”

没有弄错。为什么我收到此错误而不是向 iOS 设备发送通知?任何人都可以指导我吗?

最佳答案

最后我选择了 vps 而不是共享主机。Lucabro 的评论帮我解决了。谢谢 Lucabro。

关于iphone - Apns 错误 "Failed to connect to APNS: 110 Connection timed out.",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19025488/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com