0.0.4 • Published 7 years ago

onesignal-api-override v0.0.4

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

One Signal

npm npm

Installation

npm install onesignal-api-override --save

Usage

// Create a client object
var oneSignal = require('onesignal')('[apiKey]', '[appId]', true);

OneSignal(apiKey, appId, sandbox)

One Signal Client

ParamTypeDescription
apiKeyStringREST API Key
appIdStringOneSignal App ID
sandboxBooleanuse the sandbox certificate for iOS (default: false)

Methods

addDevice(identifier, osType) ⇒ Promise

Register a new device and its identifier to OneSignal and get OneSignal ID.

Returns: Promise - resolve with OneSignal ID

ParamTypeDescription
identifierStringthe device token
osTypeStringios, android

editDevice(oneSignalId, newIdentifier) ⇒ Promise

Update the identifier of an existing device.

ParamTypeDescription
oneSignalIdStringthe one signal device id
newIdentifierStringthe new device token

createNotification(message, data, oneSignalIds) ⇒ Promise

Create and send a notification.

ParamTypeDescription
messageStringthe notification message
dataObjectany custom data
oneSignalIdsArraya list of OneSignal devices ids

License

This project is under the MIT license.