Module: BMSPush

Cordova module to handle device requests.

Methods

initialize(pushAppGuid, clientSecret, bluemixRegion, pushOptions)

Sets the base URL for the authorization server.

This method should be called before you send the first request that requires authorization.

Parameters:
Name Type Description
pushAppGuid string

AppGUID from IBM cloud Push Notifications instance

clientSecret string

ClientSecret from IBM cloud Push Notifications instance

bluemixRegion string

Specifies the region of the application

pushOptions json

Initialize options like categories, deviceId and variable

registerDevice(settings, success, failure)

Registers the device on to the IMFPush Notification Server

Parameters:
Name Type Description
settings json

userId: user id value

success Object

callback

failure Object

callback

registerNotificationsCallback(callback)

A listner to the incoming notifications

Parameters:
Name Type Description
callback Object

A listner object

retrieveAvailableTags(success, failure)

Gets all the available Tags for the backend mobile application

Parameters:
Name Type Description
success Object

callback

failure Object

callback

retrieveSubscriptions(success, failure)

Gets the Tags that are subscribed by the device

Parameters:
Name Type Description
success Object

callback - recieves array of subscribed tags

failure Object

callback

setNotificationStatusListener(callback)

A listner to changes in the notifications status

Parameters:
Name Type Description
callback Object

A listner object

subscribe(tags, success, failure)

Subscribes to a particular backend mobile application Tag(s)

Parameters:
Name Type Description
tags Array.<string>

The Tag array to subscribe to.

success Object

callback

failure Object

callback

unregisterDevice(success, failure)

Unregisters the device from the IMFPush Notification Server

Parameters:
Name Type Description
success Object

callback

failure Object

callback

unsubscribe(tags, success, failure)

Unsubscribes from an backend mobile application Tag(s)

Parameters:
Name Type Description
tags Array.<string>

The Tag name array to unsubscribe from.

success Object

callback

failure Object

callback