rb-airgram

Created: 2012-03-20 20:11
Updated: 2013-09-30 07:07

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.

Cookies help us deliver our services. By using our services, you agree to our use of cookies Learn more