@palmabit/onesignal-notification
OneSignal Notification API wrapper
Last updated 2 years ago by palmabit-dev .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @palmabit/onesignal-notification 
SYNC missed versions from official npm registry.

OneSignal Nodejs Notification api wrapper

Tests

This is an unofficial wrapper/client for the OneSignal notification API that runs on Node.JS. A list of selected wrappers for different languages and environments is available at the Developer site's Libraries page.

Installation

$ npm install @palmabit/onesignal-notification

Usage

const OnesignalNotificationApi = require('@palmabit/onesignal-notification')
const oneSignal = new OnesignalNotificationApi('MY-REST-KEY', 'APP-ID')

const message = {
  it: 'Some message',
  en: 'Some message'
}

oneSignal.sendToAll(message, null, null, (err, res) => {
  console.log(err)
  console.log(res)
})

API

sendToAll

const OnesignalNotificationApi = require('@palmabit/onesignal-notification')
const oneSignal = new OnesignalNotificationApi('MY-REST-KEY', 'APP-ID')
oneSignal.sendToAll(message, options, action, (err, res) => {
  console.log(err)
  console.log(res)
})

sendToSegment

const OnesignalNotificationApi = require('@palmabit/onesignal-notification')
const oneSignal = new OnesignalNotificationApi('MY-REST-KEY', 'APP-ID')
oneSignal.sendToSegments(message, ['segment1', 'segment2], (err, res) => {
  console.log(err)
  console.log(res)
})

sendToDevices

//Coming Soon

...

Test

npm test

Coverage

npm run coverage

Development

See something you think can be improved? Open an issue or clone the project and send a pull request with your changes.

Author

Palmabit

License

MIT license

Current Tags

  • 1.0.0                                ...           latest (2 years ago)

3 Versions

  • 1.0.0                                ...           2 years ago
  • 0.1.3                                ...           2 years ago
  • 0.1.2                                ...           2 years ago
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 4
Dependencies (1)
Dev Dependencies (6)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |