MCSNotificationsCordovaPlugin
Class responsible for receiving Firebase cloud messaging notifications.
Callers should use MCSNotificationsCordovaPlugin global object.
Methods
cancelAllNotifications(callback, errorCallbackopt)
Cancel all notifications in the tray
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
callback |
|||
errorCallback |
MCSNotificationsCordovaPlugin~errorCallback |
<optional> |
triggered on the error |
onMessageReceived(callback, errorCallbackopt)
Subscribe to message received event
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
callback |
MCSNotificationsCordovaPlugin~messageReceivedCallback | ||
errorCallback |
MCSNotificationsCordovaPlugin~errorCallback |
<optional> |
triggered on the error |
onTokenRefresh(callback, errorCallbackopt)
Subscribe to token refresh event that called:
- to retrieve device token
- when the system determines that the device token need to be refreshed.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
callback |
MCSNotificationsCordovaPlugin~tokenRefreshCallback | triggered on the new token received | |
errorCallback |
MCSNotificationsCordovaPlugin~errorCallback |
<optional> |
triggered on the error |
setLogLevel(level)
Set log level for plugin logger
Parameters:
Name | Type | Description |
---|---|---|
level |
number | NONE: 0, ERROR: 1, WARN: 2, INFO: 3, DEBUG: 4 |
Type Definitions
errorCallback(error)
This callback called when error happen.
Parameters:
Name | Type | Description |
---|---|---|
error |
object | error object |
messageReceivedCallback(message)
This callback used to retrieve notification messages.
Parameters:
Name | Type | Description |
---|---|---|
message |
INotificationMessage | notification message |
tokenRefreshCallback(token)
This callback used to retrieve device token.
Parameters:
Name | Type | Description |
---|---|---|
token |
string |