PushNotifications.sendPushNotification()

Send a push notification using APN or GCM

Usage

Hover over inputs/exits for more info.

var PushNotifications = require('machinepack-pushnotifications-it');


// Send a push notification using APN or GCM

PushNotifications.sendPushNotification({

message: {},

deviceToken: [],

connectionOptions: {},

type: 0,

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// OK.

success: function () {

 

},

});

Inputs

message required

The notification object (https://www.npmjs.com/package/apn or https://www.npmjs.com/package/node-gcm)

{}
deviceToken required

The token device or an array of device tokens

[]
connectionOptions required

The connection options (https://www.npmjs.com/package/apn or https://www.npmjs.com/package/node-gcm)

{}
type required

The type of push notification (0: Google, 1: Apple)

0

Exits

error

An unexpected error occurred.

success

OK.