php - Not able to connect my app server to GCM's CCS using XMPPHP -


like push-notification(downstream message), want implement upstream messaging android device app server in php. using this xmpphp library github connect app server gcm's ccs. when try execute below code 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 getting following error.

1455354076 [info]: connecting tls://gcm-preprod.googleapis.com:5236 1455354106 [error]: not connect. not connect before timeout.

how ccm know where(which app server) send upstream message? there no explanation in provided documentation.

i think missed part in documentation says:

to initiate upstream message, client app sends request containing following:

  • the address of receiving app server, in format sender_id@gcm.googleapis.com.
  • a message id should unique per sender id.
  • the message data comprising key/value pairs of message's payload.

you need specify sender_id know server sending to. sender id project number acquired api console

how handle upstream message in php? using php in backend.

this thread might you. read comments in accepted answer.

it says in order use php need library supports xmpp protocol.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -