Airship Ruby Library¶
urbanairship is a Ruby library for using the Airship web service API for push notifications and
rich app pages.
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¶
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 UA application.
Note that channels are preferred over
documentation on channels.
require 'urbanairship' UA = Urbanairship airship = UA::Client.new(key:'application_key', secret:'master_secret') p = airship.create_push p.audience = UA.all p.notification = UA.notification(alert: 'Hello') p.device_types = UA.all p.send_push
The library uses unirest for communication with the UA API.
The library source code is available on GitHub.
Tests can be run with rspec:
- Defining and Sending Push Notifications
- Retrieving Device Information
- Channel Uninstall
- Named User
- Static Lists
- Create and Send
- Create and Send to Email Channels
- Create and Send to SMS Channels
- Create and Send to MMS Channels
- Create and Send to Open Channels
- Open Channels
- SMS Channel
- A/B Tests