0.1.0 • Published 10 years ago

pushco v0.1.0

Weekly downloads
3
License
ISC
Repository
github
Last release
10 years ago

#PUSH.co API#

A nodejs implementation for the PUSH.co Notification Service API.

Instalation:

npm

$ npm install pushco

Usage:

1. Load it
var pushco	= require('pushco');
2. Create Instance:
var pusher = new pushco.Push(api_key, api_secret);
3a. Push Message
pusher.pushMessage( message[, notification_type, article, imageUrl] );

NOTE: To send to all channels use notification_type = '*'

3b. Push Url
pusher.pushUrl( message, url[, notification_type] );
3c. Push Location
//as params
pusher.pushLocation( message, latitude, longitude[, notification_type] );

// or as array
pusher.pushLocation( message, [latitude, longitude][, notification_type] );

// or as object
pusher.pushLocation( message, {latitude:'latitude' ,longitude: 'longitude'}[, notification_type] );
4a. Listen for response
pusher.on('response', function( response ){
	console.info( response );
});
4b. Listen for errors
pusher.on('error', function( err, response ){
	console.error(err);
});

Todo:

  • Create User Class

    	* Authorize methods
    	* Subscription methods
    	* Clannel methods

API Docs:

push.co/api