Making GCM client in Android and Application server in Ruby on Rails

It is always fun to play with new APIs and tools. GCM is not something I was getting my hands on for the first time but it changed completely since last time I did a project using this.

But the good news is it has changed for good. New service classes makes it easier to write GCM clients for Android, GCM default configuration makes writing test servers and apps to play with very less tedious. In fact my first reaction was this is GCM reincarnated. 

GCM Client and App server
GCM Client and App server

New API : New Party!

You can have a look at the source code here :

https://github.com/priyankvex/GCM-Android-Client-and-Rails-Server

To create Android client I stuck with sample provided in the docs. Sweet and simple to implement. Just little tweaks done to make it fit my needs.

For creating application server i.e the 3rd party server required by the GCM stack, it used Ruby on Rails. In that specifically I used “gcm” gem.

Again not a very complex server but good enough to get a hold of things.

Server features : 

  1. Save incoming device tokens (registration ids).
  2. Web form to send message to all devices registered.
  3. Send welcome notification when device is registered.

Client features (Android App) :

  1. Get GCM token for the device.
  2. Send token to applications server.
  3. Show notification when message is pushed from server.

 

2 responses to “Making GCM client in Android and Application server in Ruby on Rails”

  1. It would be nice to have support for Upstream Messages (Android => Rails) thru GCM, but I cannot find much about it. See my post at http://stackoverflow.com/questions/34300481/gcm-xmpp-upstream-messages-ruby-on-rails

    Like

    1. I’ll work on that too. Thanks for bringing it up.

      Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: