React-Native module to handle device requests.
Methods
init(config)
Creates a PushNotification instance
Parameters:
Name | Type | Description |
---|---|---|
config |
Object | The push initialise parameters like appGUID, clientSecret,region etc. |
Returns:
The PushNotification object for calls to be linked.
register(options)
Register device to IBM cloud push notifications instance
Parameters:
Name | Type | Description |
---|---|---|
options |
Object | The push register parameter like userId. |
Returns:
Response from the server.
registerNotificationsCallback(eventListenerName)
Method to listen to push events
Parameters:
Name | Type | Description |
---|---|---|
eventListenerName |
string | Name of the push event, by default its |
retrieveAvailableTags()
Retrieve available tags from IBM cloud push notifications instance.
Returns:
Response from the server.
retrieveSubscriptions()
Retrieve all tag subscriptions of the device from IBM cloud push notifications instance
Returns:
Response from the server.
setNotificationStatusListener(eventListenerName)
Method to listen to push status change events
Parameters:
Name | Type | Description |
---|---|---|
eventListenerName |
string | Name of the push change event, by default its |
subscribe(tag)
Subscribe to a tag in IBM cloud push notifications instance
Parameters:
Name | Type | Description |
---|---|---|
tag |
string | The tag name. |
Returns:
Response from the server.
unregisterDevice()
Un-register device to IBM cloud push notifications instance
Returns:
Response from the server.
unsubscribe(tag)
Un-subscribe from a tag in IBM cloud push notifications instance
Parameters:
Name | Type | Description |
---|---|---|
tag |
string | The tag name. |
Returns:
Response from the server.