A Ruby wrapper for the Urban Airship API.
Ruby
Latest commit ad1d2e9 Jun 14, 2016 @madelgi madelgi committed on GitHub Merge pull request #37 from urbanairship/fix-platform-override-docs
Fix platform override docs
Permalink
Failed to load latest commit information.
bin perform some cleanup Jun 19, 2015
docs fix platform override docs Jun 14, 2016
lib bump version for named user May 16, 2016
spec Add named user audience selector Mar 13, 2016
.gitignore Added .idea dir to .gitignore Jul 30, 2015
.rspec Core Push May 5, 2015
.travis.yml Audience selectors and scheduled time Apr 23, 2015
CHANGELOG Merge pull request #36 from urbanairship/bump-version May 16, 2016
Gemfile clean up gemfile Jul 9, 2015
Guardfile Core Push May 5, 2015
LICENSE
README.rst update Readme May 16, 2016
Rakefile Core Push May 5, 2015
urbanairship.gemspec Added ChannelInfo and ChannelList. Jul 29, 2015

README.rst

https://travis-ci.org/urbanairship/ruby-library.svg?branch=master

About

urbanairship is a Ruby library for using the Urban Airship web service API for push notifications and rich app pages.

Requirements

As of Version 3.0, a Ruby version >= 2.0 must be used.

Functionality

Version 3.0 is a major upgrade and backwards incompatible with earlier versions.

To encourage the use of our SDK, which takes care of proper channel registration, support for device token registration has been removed. Support for v1 endpoints will also be removed and transitioned to their v3 equivalents where possible.

A more detailed list of changes can be found in the CHANGELOG.

Installation

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

Usage

Once the gem has been installed you can start sending pushes! See the full documentation, api examples, as well as the Urban Airship API Documentation for more information.

Broadcast to All Devices

>>> 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

Simple Tag Push

>>> require 'urbanairship'
>>> UA = Urbanairship
>>> airship = UA::Client.new(key:'application_key', secret:'master_secret')
>>> p = airship.create_push
>>> p.audience = UA.tag('some_tag')
>>> p.notification = UA.notification(alert: 'Hello')
>>> p.device_types = UA.all
>>> p.send_push

Questions

The best place to ask questions is our support site: http://support.urbanairship.com/

Contributing

  1. Fork it ( https://github.com/urbanairship/ruby-library )
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes git commit -am 'Add some feature'
  4. Push to the branch git push origin my-new-feature
  5. Create a new Pull Request
  6. Sign Urban Airship's contribution agreement.

Note: Changes will not be approved and merged without a signed contribution agreement

Development

After checking out the repo, ensure you have bundler installed ($ gem install bundler) run:

>>> $ bin/setup

to install dependencies. Then, run:

>>> $ bin/console

for an interactive prompt that will allow you to experiment.

OR you can build a local gem to play with:

>>> $ gem build urbanairship.gemspec
>>> $ gem install ./urbanairship-<VERSION>.gem

Having a local build will give you better logging if you are running into issues, but be careful to make sure to use our released public gem in Production.