Skip to content

babinc/simple-ionic-push

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

#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);
});

About

Easy way to send push notifications to the Ionic API with your node server

Resources

Stars

Watchers

Forks

Packages

No packages published