You cannot simply register with GCM on the client side and send messages to your server. This only takes care of the connection between your device and the GCM server.
You need to configure your server to connect to the GCM Cloud Connection Server (CCS) in order to be able to send and receive messages on your server:
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. This means the XMPP client must initiate a TLS connection. For example, in smack, you would call setSocketFactory (SSLSocketFactory), similar to the "old SSL style" of XMPP connections and https.
CCS requires a SASL PLAIN authentication mechanism, using @ gcm.googleapis.com (GCM sender ID) and the API as a password, where the sender ID and API key are the same as those described in the Getting Started section.
You can use most XMPP libraries to interact with CCS.
source share