simple-ionic-push

1.0.1 • Public • Published

#Simple Ionic Push This is a simple to way to push notifications to the ionic API server with your node server.

Install Simple-Ionic-Push

$ npm install --save simple-ionic-push

NPM

##Require the package

var ionicPush = require('simple-ionic-push')('Your API Token from Ionic');

Pushes will return a promise, and passed the success or error responses from the Ionic API.

##Sending a push

var tokens = [];
tokens.push('yourDeviceToken');

var notification = {
  "tokens": tokens,
  "profile": "prod",
  "notification": {
    "message": "Hello World!"
  }
};
    
ionicPush.send(notification).then(function(response) {
  return res.status(201).send(response);
  }, function(error) {
  return res.status(400).send(error);
});

Readme

Keywords

Package Sidebar

Install

npm i simple-ionic-push

Weekly Downloads

0

Version

1.0.1

License

GNU General Public License v3

Last publish

Collaborators

  • babinc