1.0.1 • Published 7 years ago

ionic-push v1.0.1

Weekly downloads
10
License
MIT
Repository
github
Last release
7 years ago

npm version Build Status Dependency Status devDependency Status

ionic-push

A node client for pushing android and ios notifications to your ionic app.

Install

npm install --save ionic-push

Usage

import IonicPush from 'ionic-push';

const ionic = new IonicPush(myJwt, myProfile);

ionic.push({
	"tokens": ["your", "device", "tokens"],
	"notification": {
    	"title": "Hi",
    	"message": "Hello world!",
    "android": {
    	"title": "Hey",
        "message": "Hello Android!"
    },
    "ios": {
        "title": "Howdy",
        "message": "Hello iOS!"
    }
  }
});

require

var IonicPush = require('ionic-push').default;

var ionic = new IonicPush(myJwt, myProfile);

Api

new IonicPush

Create a new IonicPush instance.

Arguments

Returns

An IonicPush instance.

Example
import IonicPush from 'ionic-push';

const ionic = new IonicPush(myJwt, myProfile);

testToken

Test if your token is valid.

Returns

A Promise.

Example

ionic.testToken().then(function() {
	console.log('my token is ok');
}).catch(function(err) {
	console.log('there is an error', err);
});

push

Push a new notification.

Arguments

Returns

A Promise.

Example

ionic.push({
	"tokens": ["your", "device", "tokens"],
	"notification": {
    	"title": "Hi",
    	"message": "Hello world!",
    "android": {
    	"title": "Hey",
        "message": "Hello Android!"
    },
    "ios": {
        "title": "Howdy",
        "message": "Hello iOS!"
    }
  }
}).then(function() {
	console.log('successfully sent push');
}).catch(function(err) {
	console.log('there is an error', err);
});

checkStatus

Check the status of a notification.

Arguments

Returns

A Promise.

Example

checkStatus(myuuid).then(function(data) {
	console.log(data);
}).catch(function(err) {
	console.log('there is an error', err);
});
1.0.1

7 years ago

1.0.0

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago