Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6354769
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T22:37:59+00:00 2026-05-24T22:37:59+00:00

What is the best way to send push notifications through Urban AirShip using a

  • 0

What is the best way to send push notifications through Urban AirShip using a Rails 3 web app?

From Urban Airship documentation:

An HTTP POST to /api/push/broadcast/
sends the given notification to all
registered device tokens for the
application. The payload is in JSON
with content-type application/json,
with this structure:

{
    "aps": {
         "badge": 15,
         "alert": "Hello from Urban Airship!",
         "sound": "cat.caf"
    },
    "exclude_tokens": [
        "device token you want to skip",
        "another device token you want to skip"
    ]
}

I really don’t know where to start!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T22:37:59+00:00Added an answer on May 24, 2026 at 10:37 pm

    Better way is to use UrbanAirship Groupon version. Their docs specify every thing very clearly and it will much neater code. Worked and tested in my application.

    From the read me file, (with some more comments and all):-

    Note: if you are using Ruby 1.8, you should also install the system_timer gem for more reliable timeout behaviour. See http://ph7spot.com/musings/system-timer for more information. Baically

      gem install system_timer
    

    Installation

     gem install urbanairship 
     # or specify in your gem file 
     gem "urbanairship"
    

    Configuration define all this in initializes directory and then make sure u restart your application.

        Urbanairship.application_key = 'application-key'
        Urbanairship.application_secret = 'application-secret'
        Urbanairship.master_secret = 'master-secret'
        Urbanairship.logger = Rails.logger
        Urbanairship.request_timeout = 5 # default
    

    Usage

    Registering a device token

        Urbanairship.register_device 'DEVICE-TOKEN' # => true
    

    Unregistering a device token

        Urbanairship.unregister_device 'DEVICE-TOKEN' # => true
    

    Sending a push notification (for instant delivery remove 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 # => true
    

    Batching push notification sends (for instant delivery remove schedule_for attribute)

        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 # => true
    

    Sending broadcast notifications
    Urbanairship allows you to send a broadcast notification to all active registered device tokens for your app.(for instant delivery remove schedule_for attribute)

        notification = {
          :schedule_for => 1.hour.from_now,
          :aps => {:alert => 'Important announcement!', :badge => 1}
        }
    
        Urbanairship.broadcast_push notification # => true
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What is the best way to send HTTP requests from Windows Powershell?
what is best way to send email from PHP using server authantication. Userid &
Which is Best way to send data to aspx page, and why ? using
What is the best way to send a series of data (float array) from
What is the best way to send a float in a windows message using
I am wondering what the best way to send bulk emails is using System.Net.Mail
What is the best way to send email from sql server 2008 (script). Any
What's the best way to send data from client to server? The example code
What is the best way to send messages from PHP script to Java program
What is the best way to send and receive netlink messages from userspace in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.