You may have already heard about this. This was announced on Google IO, perhaps a month ago. Google cloud messages were only downstream (server β phone), but now with CCS (cloud computing server) you can send messages upstream through a permanent TCP connection thanks to the XMPP protocol. I have already developed an application that works with GCM and HTTP. It uses the gcm library and the classes that are packed there (e.g. GCMRegistrar). These classes are now deprecated, and Google recommends using the GoogleCloudMessaging API.
Now everything works a little differently. You have Google documentation and they explain very well how you can design your Android app. BUT I have problems with the server, because I have never worked with XMPP before. Here they give the code in Python: http://developer.android.com/google/gcm/gs.html but I have no idea about Python. So I researched and then found the XMPPHP library. Then you can work with PHP and use the library to connect to XMPP and send / receive messages.
I have no experience with him and it does not work for me. How to open an XMPP connection with a Google XMPP server?
I found this way to open the connection (here you are working with the library):
$conn = new XMPPHP_XMPP($host, $port, $user, $password, $resource, $server, $printlog, $loglevel);
Does anyone know what parameters I need to pass here in order to contact Google CCS?
I would also like to know:
How to send a message on XMPP to a device? How can I receive a message from the device?
EstefanΓa
source share