Android listeners
OnRegisterForPushListener
onRegisterForPushRequired(PushRegistrationOrigin origin)
This method is called when Synerise needs registration for push notifications.
See Configuring push notifications for more details.
- void onRegisterForPushRequired(PushRegistrationOrigin origin);
| Parameter | Type | Description |
|---|---|---|
| origin | PushRegistrationOrigin | Information about the cause of the registration |
onRegisterForPushRequired()
This method is called when Synerise needs registration for push notifications.
See Configuring push notifications for more details.
- void onRegisterForPushRequired();
OnNotificationListener
A listener to handle events from Synerise notifications.
See Configuring push notifications for more details.
onNotificationReceived(NotificationInfo notificationInfo)
This method is called when a Synerise notification is received.
- public void onNotificationReceived(NotificationInfo notificationInfo)
| Parameter | Type | Description |
|---|---|---|
| notificationInfo | NotificationInfo | Object providing info about the notification. |
onNotificationDismissed(NotificationInfo notificationInfo)
This method is called when a Synerise notification is dismissed.
- public void onNotificationDismissed(NotificationInfo notificationInfo)
| Parameter | Type | Description |
|---|---|---|
| notificationInfo | NotificationInfo | Object providing info about the notification. |
onNotificationClicked(NotificationInfo notificationInfo)
This method is called when a Synerise notification is clicked.
- public void onNotificationClicked(NotificationInfo notificationInfo)
| Parameter | Type | Description |
|---|---|---|
| notificationInfo | NotificationInfo | Object providing information about the notification. |
onActionButtonClicked(NotificationInfo notificationInfo, String actionButton)
This method is called when an action button is clicked in a Synerise notification.
- public void onActionButtonClicked(NotificationInfo notificationInfo, String actionButton)
| Parameter | Type | Description |
|---|---|---|
| notificationInfo | NotificationInfo | Object providing information about the notification. |
| actionButton | String | Text on the clicked action button. |
OnClientStateChangeListener
A listener to handle customer’s sign-in state changes.
To set your object with listener methods, you must use this method.
onClientSignedIn()
This method is called when the customer signs in.
- public void onClientSignedIn()
onClientSignedOut(ClientSessionEndReason reason)
This method is called when the customer signs out.
- public void onClientSignedOut(ClientSessionEndReason reason)
| Parameter | Type | Description |
|---|---|---|
| reason | ClientSessionEndReason | Specifies the reason for signing out. |
OnInjectorListener
onOpenUrl(SyneriseSource source, String url)
A listener to handle events from campaigns.
Fired when a customer interacts with the URL action.
This method returns true if activity is closed after executing an action; in other case, it returns false.
- boolean onOpenUrl(SyneriseSource source, String url)
| Parameter | Type | Description |
|---|---|---|
| source | SyneriseSource | Interaction source |
| url | String | URL value from the action of the activity |
onOpenUrl(InjectorSource source, String url)
A listener to handle events from campaigns.
Fired when a customer interacts with the URL action.
This method returns true if activity is closed after executing an action; in other case, it returns false.
- boolean onOpenUrl(InjectorSource source, String url)
| Parameter | Type | Description |
|---|---|---|
| source | InjectorSource | Interaction source |
| url | String | URL value from the action of the activity |
onDeepLink(SyneriseSource source, String deepLink)
Fired when a customer interacts with the DEEP_LINKING action.
The method returns true if activity is closed after executing the action; in other case, it returns false.
- boolean onDeepLink(SyneriseSource source, String deepLink)
| Parameter | Type | Description |
|---|---|---|
| source | SyneriseSource | Interaction source |
| deepLink | String | Deep link value from the action of the activity |
onDeepLink(InjectorSource source, String deepLink)
Fired when a customer interacts with the DEEP_LINKING action.
The method returns true if activity is closed after executing the action; in other case, it returns false.
- boolean onDeepLink(InjectorSource source, String deepLink)
| Parameter | Type | Description |
|---|---|---|
| source | InjectorSource | Interaction source |
| deepLink | String | Deep link value from the action of the activity |
OnInAppListener
A listener to handle the states of in-app message.
To set your object with listener methods, you must use this method.
shouldShow(InAppMessageData inAppMessageData)
This method is called after an in-app message is loaded and Synerise SDK asks for permission to show it.
boolean shouldShow(InAppMessageData inAppMessageData)
| Parameter | Type | Description |
|---|---|---|
| inAppMessageData | InAppMessageData | In-app message data. |
onShown(InAppMessageData inAppMessageData)
This method is called after an in-app message appears.
void onShown(InAppMessageData inAppMessageData)
| Parameter | Type | Description |
|---|---|---|
| inAppMessageData | InAppMessageData | In-app message data. |
onDismissed(InAppMessageData inAppMessageData)
This method is called after an in-app message disappears.
void onDismissed(InAppMessageData inAppMessageData)
| Parameter | Type | Description |
|---|---|---|
| inAppMessageData | InAppMessageData | In-app message data. |
onContextFromAppRequired(InAppMessageData inAppMessageData)
This method is called when an individual context (for example a profile ID, an item SKU) for an in-app message is needed.
HashMap<String, Object> onContextFromAppRequired(InAppMessageData inAppMessageData)
| Parameter | Type | Description |
|---|---|---|
| inAppMessageData | InAppMessageData | In-app message data. |
onHandledOpenUrl(InAppMessageData inAppMessageData)
This method is called when the SRInApp.openUrl(url) method is used in an in-app message.
void onHandledOpenUrl(InAppMessageData inAppMessageData)
| Parameter | Type | Description |
|---|---|---|
| inAppMessageData | InAppMessageData | In-app message data. |
onHandledOpenDeepLink(InAppMessageData inAppMessageData)
This method is called when the SRInApp.openDeeplink(url) method is used in an in-app message.
void onHandledOpenDeepLink(InAppMessageData inAppMessageData)
| Parameter | Type | Description |
|---|---|---|
| inAppMessageData | InAppMessageData | In-app message data. |
onCustomAction(String identifier, HashMap<String, Object> params, InAppMessageData inAppMessageData)
This method is called when the SRInApp.handleCustomAction(name, params) method is used in an in-app message.
void onCustomAction(String identifier, HashMap<String, Object> params, InAppMessageData inAppMessageData)
| Parameter | Type | Description |
|---|---|---|
| inAppMessageData | InAppMessageData | In-app message data. |
| identifier | String | Identifier of the custom action. |
| params | HashMap<String, Object> | Custom action parameters. |
OnLocationUpdateListener
A listener to handle events about location.
onLocationUpdateRequired()
This method is called when the Tracker module requests a location update.
- void onLocationUpdateRequired()
OnContentWidgetListener
A listener to handle Content Widget actions.
onLoad(ContentWidget contentWidget)
This method is called after a widget is loaded.
- void onLoad(ContentWidget contentWidget)
| Parameter | Type | Description |
|---|---|---|
| **contentWidget` | ContentWidget | The widget instance that called the listener method |
onLoadingError(ContentWidget contentWidget, ApiError apiError)
This method is called when an error occurs while loading a widget.
- void onLoadingError(ContentWidget contentWidget, ApiError apiError)
| Parameter | Type | Description |
|---|---|---|
| contentWidget | ContentWidget | The widget instance that called the listener method |
| apiError | ApiError | The error that occurred |
onClickActionReceive(ContentWidget contentWidget, BaseModel model)
This method is called when the customer clicks a widget’s item.
- void onClickActionReceive(ContentWidget contentWidget, BaseModel model)
| Parameter | Type | Description |
|---|---|---|
| contentWidget | ContentWidget | The widget instance that called the listener method |
| model | BaseModel | The model’s object that was clicked |
onLoading(ContentWidget contentWidget, boolean isLoading)
This method is called when the widget’s loading state changes.
- void onLoading(ContentWidget contentWidget, boolean isLoading)
| Parameter | Type | Description |
|---|---|---|
| contentWidget | ContentWidget | The widget instance that called the listener method |
| isLoading | Boolean | Widget’s loading state |
onSizeChange(ContentWidget contentWidget, ViewGroup.LayoutParams size)
This method is called when the widget’s size changes.
- void onSizeChange(ContentWidget contentWidget, ViewGroup.LayoutParams size)
| Parameter | Type | Description |
|---|---|---|
| contentWidget | ContentWidget | The widget instance that called the listener method |
| size | ViewGroup.LayoutParams | Widget’s new size |