Firebase Cloud Messaging: Difference between revisions

From Wildsong
Jump to navigationJump to search
Brian Wilson (talk | contribs)
mNo edit summary
Brian Wilson (talk | contribs)
mNo edit summary
Line 6: Line 6:


My understanding is this
My understanding is this
* Mobile client sends message to GCM via XMPP
* Mobile client sends message to GCM via [[XMPP]]
* GCM forwards message to 3rd party server (that's me).
* GCM forwards message to 3rd party server (that's me).
* 3rd party server can send messages to clients via GCM server.
* 3rd party server can send messages to clients via GCM server.
Line 12: Line 12:
Advantages
Advantages
* Google server can do store and forward so neither mobile nor my server need be online 100% of the time.
* Google server can do store and forward so neither mobile nor my server need be online 100% of the time.
* Saves battery by using only one connection for all services with phone.


It is unclear to me the relationship between "GCM" and "GCM Cloud Connection Server" http://developer.android.com/google/gcm/ccs.html
It is unclear to me the relationship between "GCM" and "GCM Cloud Connection Server" http://developer.android.com/google/gcm/ccs.html
Line 18: Line 19:
It looks like I should be able to use an XMPP client to talk to CCS from my server. Then Google handles the interaction with my phone.
It looks like I should be able to use an XMPP client to talk to CCS from my server. Then Google handles the interaction with my phone.


* Java -
Python - There is a sample on the Google page. http://developer.android.com/google/gcm/ccs.html
* Python - There is a sample on the Google page. http://developer.android.com/google/gcm/ccs.html
* PHP


=== sample gcm server ===
It also looks like there are many hoops to jump through and at the moment I don't need this. [[XMPP]] for me.
 
=== Sample gcm server ===


Web App that runs in Tomcat
Web App that runs in Tomcat

Revision as of 02:57, 26 May 2013

AKA GCM

http://developer.android.com/google/gcm/index.html

Overview

My understanding is this

  • Mobile client sends message to GCM via XMPP
  • GCM forwards message to 3rd party server (that's me).
  • 3rd party server can send messages to clients via GCM server.

Advantages

  • Google server can do store and forward so neither mobile nor my server need be online 100% of the time.
  • Saves battery by using only one connection for all services with phone.

It is unclear to me the relationship between "GCM" and "GCM Cloud Connection Server" http://developer.android.com/google/gcm/ccs.html CCS is XMPP based. I am coming to the game late, seems like the old way was just HTTP based? Enlighten me please.

It looks like I should be able to use an XMPP client to talk to CCS from my server. Then Google handles the interaction with my phone.

Python - There is a sample on the Google page. http://developer.android.com/google/gcm/ccs.html

It also looks like there are many hoops to jump through and at the moment I don't need this. XMPP for me.

Sample gcm server

Web App that runs in Tomcat

Sends a message to any registered Android devices that says "You got a message".

WebContent/

index.jsp just loads home via webmapping /home

WEB-INF/

lib/

  • gcm-server.jar -- sources are at the root level in the gcm code
  • json_simple-1.1.jar -- probably a json parser

Servlets

  • RegisterServlet -- accepts connections
  • UnregisterServlet --
  • SendAllMessagesServlet -- sends a message to all registered devices
  • HomeServlet - displays existing messages and allows sending a new one