What you will use:

Some android app that registers to GCM and sends registration id to backend API

Pros

Really simple to implement - no magic

Small library - 179 lines of code

It makes use of Google Cloud Messaging

Can be used both for Android and iOS (we tested only with Android)

Cons

Google Cloud Messaging might be not viable for you if you require very low latency - see Messenger case study

Step 1

Add to Gemfile:

gem ‘gcm’

And run bundle install

Step 2

Add API key to sec-config.yml:

environment: google_gcm_api: some1cool1key1here

Step 3

Now we can make use of GCM and send some notifications. In the snippet below you can find some example service object that takes registration ids (that need to be pushed by mobile clients to your backend API) and message hash which is just message that will be included in notification.

[snippet]

Step 4

Android client has to be listening to those notifications by using broadcast receiver. What it will do with those notifications will depend on business logic of your application. Sample code for such application can be found here.

I hope you like it! If you have any comments or ideas how to improve it, please share them below.