Push

For the game nummi I’ve created with 9 to 5 we needed to send push notifications. Lots of them! Therefore I created this Ruby on Rails gem which takes care of sending the push notification to Android and iOS devices. The project is hosted at github and can be found here.

The gem allows us to send up to a million push messages a day without any problems. It takes care of notifying the Ruby on Rails application of invalid device tokens so they can be removed from the database.

Features

This gem has the following features:

  • Multi-App
  • Multi-Provider (APNS, GCM, C2DM)
  • Integrated feedback processing
  • Rake task to cleanup the database
  • Database for storage (no external dependencies)

Github project pages

You can find the projects on Github:

Example

After configuration sending a message is as easy as:

1
2
3
4
5
6
7
8
Push::MessageApns.create(
    app: 'app_name',
    device: '<APNS device_token here>',
    alert: 'Hello World',
    sound: '1.aiff',
    badge: 1,
    expiry: 1.day.to_i,
    attributes_for_device: {key: 'MSG'})

Copyright © 2013 - Tom Pesman - Powered by Octopress