Not able to make xmpp connection between my app server and GCM's CCS using XMPPHP library
Asked Answered
D

2

19

Like push-notification(downstream message), I want to implement upstream messaging from my android device to my app server in php.

I am using this XMPPHP library from Github to connect my app server to GCM's CCS. But when I try to execute below code to connect GCM's 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();
...

I am getting following error.

1455354076 [INFO]: Connecting to tls://gcm-preprod.googleapis.com:5236 1455354106 [ERROR]: Could not connect. Could not connect before timeout.
Doggoned answered 13/2, 2016 at 17:22 Comment(0)
G
1

This is most probably caused by the fact that CCS doesn't currently support the STARTTLS extension. I had the sampe problem with elixir and hedwig (see here).

Sadly I don't have enough php knowledge to check whether your XMPP library supports this, but maybe this SO thread can help you to get started with CCS and PHP.

Gastrin answered 18/2, 2016 at 22:34 Comment(0)
U
0

there is answer on a question similar to your problem here Not able to connect my app server to GCM's CCS using XMPPHP. of course if you have not been the questioner there. i hope it works.

Understand answered 23/2, 2016 at 23:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.