boxcar api notification library
$ npm install boxcar-notification
First, prepare boxcar api token from here
import BoxcarNotification from 'boxcar-notification';
let bn = new BoxcarNotification('API_TOKEN');
let notification = bn.send({
title: 'my first notification',
longMessage: 'Hello!!'
});
notification.then((body) => {
console.log('@body:', body);
}).catch((error) => {
console.log('@error:', error);
});
-
BoxcarNotification.constructor(API_TOKEN)
-
BoxcarNotification.VALID_SOUNDS
-
BoxcarNotification.API_URL
-
bn.send(options) => Promise:notification
-
options.title
-
options.longMessage
-
options.sound
-
options.sourceName
-
options.iconUrl
-
notification.then(body)
-
notification.catch(error)