It is best to use the UrbanAirship Groupon version . Everything is clearly indicated in their documents, and it will be much more accurate. Worked and tested in my application.
From the read me file (with a few comments and all): -
Note. If you are using Ruby 1.8, you should also set git system_timer for more reliable timeout behavior. See http://ph7spot.com/musings/system-timer for details. Baically
gem install system_timer
Installation
gem install urbanairship
The configuration defines all this in the initialization directory, and then make sure that you restart the application.
Urbanairship.application_key = 'application-key' Urbanairship.application_secret = 'application-secret' Urbanairship.master_secret = 'master-secret' Urbanairship.logger = Rails.logger Urbanairship.request_timeout = 5
Using
Register device token
Urbanairship.register_device 'DEVICE-TOKEN'
Unregister device token
Urbanairship.unregister_device 'DEVICE-TOKEN'
Sending push notifications (for instant delivery, remove the schedule_for attribute)
notification = { :schedule_for => 1.hour.from_now, :device_tokens => ['DEVICE-TOKEN-ONE', 'DEVICE-TOKEN-TWO'], :aps => {:alert => 'You have a new message!', :badge => 1} } Urbanairship.push notification
Sending push notifications send (remove the schedule_for attribute for instant delivery)
notifications = [ { :schedule_for => 1.hour.from_now, :device_tokens => ['DEVICE-TOKEN-ONE', 'DEVICE-TOKEN-TWO'], :aps => {:alert => 'You have a new message!', :badge => 1} }, { :schedule_for => 3.hours.from_now, :device_tokens => ['DEVICE-TOKEN-THREE'], :aps => {:alert => 'You have a new message!', :badge => 1} } ] Urbanairship.batch_push notifications
Sending Broadcast Notifications Urbanairship allows you to send broadcast notifications to all active registered device tokens for your application (remove the schedule_for attribute for instant delivery)
notification = { :schedule_for => 1.hour.from_now, :aps => {:alert => 'Important announcement!', :badge => 1} } Urbanairship.broadcast_push notification