Flutter listeners
NotificationsListener
A listener to handle actions from the notifications module.
Synerise.notifications.listener((listener) {
// The following method is called when registration for Push Notifications is needed.
listener.onRegistrationRequired = () {
...
};
});
InjectorListener
A listener to handle URL and deeplink actions from the injector module.
Synerise.injector.listener((listener) {
// The following method is called when Synerise handles URL action from campaign activities
// It is required function
listener.onOpenUrl = (url) {
...
};
// The following method is called when Synerise handles deep link action from campaign activities
// It is required function
listener.onDeepLink = (deepLink) {
...
};
});
InjectorInAppMessageListener
A listener to handle the states of in-app messages.
Synerise.injector.inAppMessageListener((listener) {
// The following method is called after an in-app message appears
listener.onPresent = (data) {
...
};
// The following method is called after an in-app message disappears
listener.onHide = (data) {
...
};
// This method is called when the SRInApp.openUrl(url) method is used in an in-app message.
listener.onOpenUrl = (data, url) {
...
};
// This method is called when the SRInApp.openDeeplink(url) method is used in an in-app message.
listener.onDeepLink = (data, deepLink) {
...
};
// This method is called when the
// SRInApp.handleCustomAction(name, params) method is used in an in-app message.
listener.onCustomAction = (data, name, parameters) {
...
};
})