Code Monkey home page Code Monkey logo

urbanairship_on_rails's Introduction

===================
URBAN AIRSHIP ON RAILS
===================

Borrowed Liberally from APN on Rails Gem but designed to interface with urbanairship for simplicity, ease of use, and speedy deployment of push notifications
uses identical data schema to APN.. perhaps allowing future upgrade to APN

=======
DEPENDENCIES
=======
requires JSON gem
Acts As State Machine

=======
HOW TO CONFIGURE
=======

	=====
	Create an initializer named urbanairship.rb with the following content

	UA::Config::app_key      = 'YOUR_APP_KEY'
	UA::Config::app_secret   = 'YOUR_APP_SECRET'
	UA::Config::push_secret  = 'YOUR_PUSH_SECRET'

	=====
	Create User => Device relationship

	belongs_to :device, :class_name=>"APN::Device"

	=====
	Set up a daily cron job to clean out inactive device registrations 
		rake apn:feedback or
		script/runner APN:Feedback.create().run

	Set up a cron job to push and manage notifications
		rake apn:push or
		script/runner APN::Notification.process_pending


=======
API CALLS and current support level
=======

REGISTRATION
	
	APN::Device.register 		=> HTTP PUT to /api/device_tokens/<device_token>
	APN::Device.read 			=> HTTP GET to /api/device_tokens/<device_token>
	APN::Device.unregister 		=> HTTP DELETE to /api/device_tokens/<device_token>

PUSH
	APN::Notifcation.push		=> HTTP POST to /api/push/

BATCH PUSH
	NOT YET SUPPORTED

BROADCAST
	NOT YET SUPPORTED

FEEDBACK SERVICE
	APN::Feedback.push(			=> HTTP GET to /api/device_tokens/feedback/?since=<timestamp> 

STATISTICS
	NOT YET SUPPORTED

=======
Example
=======

To Create and register a device
	user.device.create(:token => "token_from_device")
	user.device.register(options)

To Read device and tags
	user.device.read

To unregister a device
	user.device.unregister

To destroy device record (and unregister)
	user.device.destroy

To create push notification
	user.device.create_notification.create(:badge=>'', :alert=>'', :sound=>'')
	
To immediately push a notification
	user.device.notifications.last.push


Copyright (c) 2009 [Russell Sherman([email protected])], released under the MIT license

urbanairship_on_rails's People

Stargazers

Adam Singer avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.