Rails Push Notifications Gem

For the last months I’ve come across several backend ruby developments that required, at least, one common thing. Mobile devices push notifications.

Although it’s true that you can find several open source gems out there, I found none fully featured, bug free and suitable for both iOS and Android so I thought that could be a very good contribution for the community and, after some time working on it and testing it here is the result.

The Rails Push Notifications Gem is an intuitive and easy to use gem that will allow you to integrate both iOS and Android push notifications into your rails project.

Rails Push Notifications Gem supports:

  • Multiple iOS and Android applications/configurations
  • Ad-hoc and bulk notifications
  • Fully customisable notification’s contents
  • Apple’s both sandbox and production environments
  • Apple’s feedback service

At the moment of sending the notification(s) you’ll have feedback information available on whether the push was successful or failed.

At the moment, I’m using it successfully in two live products and having a great experience.

Visit the GitHub repository at: https://github.com/calonso/rails-push-notifications for detailed installation instructions and a step by step usage example and, please, feel free to leave a comment here if you need help or just to tell us about your experience using it!

Enjoy.

 

Enumerados

Enumerados (Numbered) is, by far, the largest project that we faced at Unkasoft. It is a multiplayer board game which goal is to build simple (+ and -) arithmetical operations by crossing your given chips with the ones that are already on the board (like Scrabble but with numbers).

From the technical point of view it involved three different developments: a backend and two native (iOS and Android) frontends. Particularly I have fully developed the backend where I were almost fully dedicated during the last two years. Lots of iterations, changes, migrations and new features were required to get the final 3.7.1 version.

The backend is fully built using Ruby on Rails, starting at version 3.1 and finishing at 3.2.13. All the infrastructure was held at Heroku where it was using 4 web dynos as average, one single worker dyno and another plugins such as AdeptScale, PGBackups, Scheduler, New Relic, Blitz, RedisToGo and a Crane PostgreSQL Database.

The communication with mobile clients is done through a HTTP REST JSON API and, due to the required evolution on the whole project, the server ended up serving 3 different API versions concurrently.

By far, the most interesting and time consuming part of the development has been the optimisation, at all levels:

  • Database: Mainly using New Relic and Posgres ‘explain analyze‘ command I designed structure modifications, queries optimisations, PL/pgSQL procedures, etc…
  • Application: Again New Relic had a key role in helping spotting the worst performing transactions and bottlenecks along with profiling and benchmarking tests execution in my local development machine and also using Heroku Blitz add-on for load testing. At this level I implemented asynchronous query handling, background pre calculations, cache-based (sync and async) solutions where possible and some algorithms and data structures optimisation. Also improved database usage.
  • API and communication with mobile frontends: At this point, using users feedback and data provided by Google Analytics and New Relic native mobiles plugin we improved the communication layer by modifying (merging/splitting) queries, background preloading some other queries, etc…

Another thing that I am very proud of is the result of the push notifications feature evolution. At the very beginning I started using two different rails gems, one for Apple and for Google integration the other. I decided to go for third party open source gems mainly because I guessed that it would take me longer to develop, test and stabilise a new one from scratch. But after a while using them I started finding bugs and missing features that were important for us, so I began developing a new Rails Push Notifications Gem from scratch that, after some time I open sourced at my Github profile.

Going back to the game itself, here you can find the download links:

Also, here you can see some screenshots on the game.