Skip to content

Latest commit

 

History

History
43 lines (32 loc) · 2.46 KB

README.rdoc

File metadata and controls

43 lines (32 loc) · 2.46 KB

pushserver

Pushserver is a ruby gem that helps Web YP to send push notification to all the devices a user has.

PushServer Gem has two main attributes.

  1. uri, This is the Push Notification Server uri. The default value is ‘184.72.174.245/pushservice.php’. To modify, use PushServer.uri = ‘new path’

  2. appId, This is the appId of the application. The default value is ‘pushtest’. To Modify, use PushServer.appId.

PusServer Gem only has one method

sendPushToUser(metadata)
  * metadata - a dictionary that holds all the infomation. Please check the "Send Push section" in http://onewiki.yellowpages.com/download/attachments/75861924/PushNotification.doc for the fields that should be included in the metadata. The filed 'm' will always be filled as "push" in the gem. The field 'appId' will be filled as the appId attribute if it is not provided in the dictionary.
  * return : true for successfully sent push notification. false for can't find any device to send. Raise exception for any other errors. 
This method will help to send push notifications. If the server can't send any push notification, the sendPushToUser will return false. If at least one push notificaiton is sent successfully, the sendPushToUser will return true.

To test, simply run the following ruby code.

require ‘pushserver’ PushServer.appId = “your appId” PushServer.uri = ‘184.72.174.245/pushservice.php’ metadata = {

'uid'=> '[email protected]',
'alert' => 'This is a test push message'}

PushServer.sendPushToUser(metadata)

Please follow the steps in onewiki.yellowpages.com/display/MB/Push+Notification+Service to register with APNS, Android c2dm and with the push notification server.

Contributing to pushserver

  • Check out the latest master to make sure the feature hasn’t been implemented or the bug hasn’t been fixed yet

  • Check out the issue tracker to make sure someone already hasn’t requested it and/or contributed it

  • Fork the project

  • Start a feature/bugfix branch

  • Commit and push until you are happy with your contribution

  • Make sure to add tests for it. This is important so I don’t break it in a future version unintentionally.

  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

Copyright © 2011 jeffwang. See LICENSE.txt for further details.