小编Cha*_*ini的帖子

无法使用XMPPHP库在我的应用服务器和GCM的CCS之间建立xmpp连接

像推送通知(下游消息),我想在我的Android设备上实现上传消息到我的app服务器.

我正在使用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();
...
Run Code Online (Sandbox Code Playgroud)

我收到了以下错误.

1455354076 [INFO]: Connecting to tls://gcm-preprod.googleapis.com:5236 1455354106 [ERROR]: Could not connect. Could not connect before timeout.
Run Code Online (Sandbox Code Playgroud)

php android xmpp xmpphp google-cloud-messaging

19
推荐指数
1
解决办法
361
查看次数

标签 统计

android ×1

google-cloud-messaging ×1

php ×1

xmpp ×1

xmpphp ×1