Pushit sends push notifications to mobile devices.
There are some gems that let you do push notifications but I wasn’t fully satisfied with them.
-
github.com/samsoffes/apple_push_notification works as an AR plugin, a mixin to any object, or by calling a class method. It doesn’t offer a DSL and has no tests.
-
github.com/PRX/apn_on_rails is based on Sam’s plugin and seems to have good test coverage. However it is an AR plugin and stores every notification in the database which seems unnecessary.
-
github.com/thegeekbird/Apns4r has no tests but looks mature otherwise. No DSL.
The main design goals of this gem are:
-
Easy to use DSL
-
Not an AR plugin
-
Extensible architecture to support other mobile devices.
Pushit.config.apple_certificate = File.read('your_apn_cert.pem') Pushit.config.environment = :production # The default is :development, which will use the sandbox servers. Pushit.deliver do |n| n.device_type :iPhone n.device_token '<42234223 42234223 42234223 42234223 42234223 42234223 42234223 42234223>' n.alert '3 new messages!' n.badge 3 n.sound 'foo.aiff' n.custom_data {'foo' => 'bar'} end
-
Fork the project.
-
Make your feature addition or bug fix.
-
Add tests for it. This is important so I don’t break it in a future version unintentionally.
-
Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
-
Send me a pull request. Bonus points for topic branches.
Copyright © 2010 Tobi Knaup. See LICENSE for details.