像推送通知(下游消息)一样,我想在 php 中实现从我的 android 设备到我的应用服务器的上游消息传递。我正在使用Github 中的这个XMPPHP 库将我的应用服务器连接到 GCM 的 CCS。但是当我尝试执行下面的代码来连接 GCM 的 CCS 时:
include 'XMPPHP/XMPP.php';
$conn = new XMPPHP_XMPP('gcm-preprod.googleapis.com', 5236, '<myProjectId>@gcm.googleapis.com', '<myApiKey>', 'xmpphp', 'http://myserverdomain', $printlog=true, $loglevel=XMPPHP_Log::LEVEL_INFO);
$conn->autoSubscribe();
$vcard_request = array();
try {
$conn->connect();
...
我收到以下错误。
1455354076 [信息]:连接到 tls://gcm-preprod.googleapis.com:5236 1455354106 [错误]:无法连接。超时前无法连接。