Airship Ruby Library\uf0c1

urbanairship is a Ruby library for using the Airship web service API for messaging.


If you have the bundler gem (if not you can get it with $ gem install bundler) add this line to your application’s Gemfile:

>>> gem 'urbanairship'

And then execute:

>>> $ bundle

OR install it yourself as:

>>> gem install urbanairship

Using the library\uf0c1

The library is intended to be used with the small footprint of a single import. To get started, import the package, and create an Airship object representing a single Airship project.

The library uses rest-client for communication with the Airship API.

require 'urbanairship'
UA = Urbanairship
airship ='application_key', secret:'master_secret')
p = airship.create_push
p.audience = UA.all
p.notification = UA.notification(alert: 'Hello')
p.device_types = UA.device_types(['ios','android'])

We in the process of migrating code examples away from these docs and into the regular Airship API reference (select “Ruby Library”), so please check there for more examples.

Please also see the README for detailed instructions on how to use bearer token auth and alternative servers.


The library source code is available on GitHub.

Tests can be run with rspec.


Indices and tables\uf0c1