Reputation: 1499
I am just going through the new features of GCM Cloud connection server. On client side this seems fairly easy using the google play services, as described in https://developer.android.com/google/gcm/ccs.html, however for the server side it says:
GCM Cloud Connection Server (CCS) is an XMPP endpoint, running on http://gcm.googleapis.com port 5235.
CCS requires a Transport Layer Security (TLS) connection. That means the XMPP client must initiate a TLS connection. For example in smack, you would call setSocketFactory(SSLSocketFactory), similar to “old style SSL” XMPP connections and https.
CCS requires a SASL PLAIN authentication mechanism using @gcm.googleapis.com (GCM sender ID) and the API key as the password, where the sender ID and API key are the same as described in Getting Started.
Does that mean I manually have to open a port and parse xml/json or is there some kind of Java API that I can use to implement the server side?
Upvotes: 3
Views: 5296
Reputation: 319
You can use Smack library to work with XMPP in Java. And here you can find an example code that sends notifications using GCM CCS.
Upvotes: 0
Reputation: 3542
For the GCM Server there is a library, the javadoc is at http://developer.android.com/reference/com/google/android/gcm/server/package-summary.html
There is a demo server app Google has written here at http://developer.android.com/google/gcm/server.html
As I understand you can choose whether you want to use the XMPP service or the old HTTP service. Not sure what the advantage is.
Upvotes: 2