Skip to content

Latest commit

 

History

History
57 lines (45 loc) · 1.08 KB

readme.md

File metadata and controls

57 lines (45 loc) · 1.08 KB

PushWoosh.js

Pushwoosh.js is a wrapper for the PushWoosh REST API

NOTE: This is a WIP, not thoroughly tested.

Installation

$ npm install PushWoosh.js

Usage

var PushWoosh = require('PushWoosh.js'),
pushWoosh = new PushWoosh({
  auth: your_auth_key,
  application: your_application_id
});

The methods available mirror that of the PushWoosh API, ie:

  • createMessage
  • deleteMessage
  • registerDevice
  • unregisterDevice
  • setTags
  • getTags
  • setBadge
  • pushStat
  • getNearestZone

See the PushWoosh API documentation for more information.

pushWoosh.createMessage({
  // see PushWoosh API reference
})
.then(function (response) {
    // do something
})
.fail(function (err) {
    // do something
});

If you need to override the application ID or supply an application group instead, you can do so:

pushWoosh.createMessage({
    application: your_id_here,
    notifications: []
}).then().fail();

More documentation to come.