rb-airgram provides a convenient wrapper around all of the current AirGram API methods, including those that require authentication.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
README.md
airgram.gemspec
rb-airgram-0.0.3.gem

README.md

#Ruby AirGram Client

This is an unofficial wrapper for the AirGram notifications service. It provides a wrapper to interact with both the guest and the authenticated methods.

###Installation

gem install rb-airgram

###Usage

You can either initialize the client with the username and password set, or if you are only planning on using the guest sending function, you can initialize it with no parameters.

require 'airgram'

# Without authentication
client = Airgram.new

# Send a notificiation with no authentication needed (url is optional)
client.send_as_guest("recipient@email.com", "Some awesome message", "http://www.bbc.com")

# Auth needed for below functions
# Username = Service Key
# Password = Service Secret
client = Airgram.new(:username => "XXXX", :password => "XXXX")

# Subscribe a new user
client.subscribe("recipient@email.com")

# Send notification to subscribed user (url is optional)
client.send("recipient@email.com", "Some awesome message", "http://www.bbc.com")

# Send notification to EVERY subscribed user (url is optional)
client.broadcast("Some awesome message", "http://www.bbc.com")

See AirGram API Docs for more information.

All methods return either true / false depending on whether the notification request succeeds.