Notifications Listener
A listener to handle actions from the notifications module.
Declared In
lib/main/modules/NotificationsModule.js
Setting up
Synerise.Notifications.setListener({
onRegistrationToken: function(token) {
// optional function
},
onNotification: function(payload) {
// optional function
},
onRegistrationRequired: function() {
// mandatory function
}
});
Functions
The following method is called when Synerise receives a registration token from the native part of application.
onRegistrationToken: function(token) {
// implementation
}
Parameter | Type | Description |
---|---|---|
token |
string |
Firebase Token |
The following method is called when registration for Push Notifications is needed.
onRegistrationRequired: function() {
// implementation
}
You need to invoke the Synerise.Notifications.registerForNotifications(registrationToken, mobileAgreement, onSuccess, onError)
method again.
The following method is called when Synerise receives a notification’s payload from the native part of application.
onNotification: function(payload) {
// implementation
}
Parameter | Type | Description |
---|---|---|
payload |
string |
Notification’s key-value data object |