push.co-api

Created: 2014-05-19 07:45
Updated: 2014-05-19 21:46
License: mit

README.md

#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

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