Class InAppMessaging
java.lang.Object
com.wonderpush.sdk.inappmessaging.InAppMessaging
The entry point of the In App Messaging headless SDK.
In-App Messaging will automatically initialize, and start listening for events.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
static interface
class
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addClickListener
(InAppMessagingClickListener clickListener) Registers a click listener with IAM, which will be notified on every IAM clickvoid
addClickListener
(InAppMessagingClickListener clickListener, Executor executor) Registers a click listener with IAM, which will be notified on every IAM click, and triggered on the provided executorvoid
addDisplayErrorListener
(InAppMessagingDisplayErrorListener displayErrorListener) Registers a display error listener with IAM, which will be notified on every IAM display errorvoid
addDisplayErrorListener
(InAppMessagingDisplayErrorListener displayErrorListener, Executor executor) Registers a display error listener with IAM, which will be notified on every IAM display error, and triggered on the provided executorvoid
addImpressionListener
(InAppMessagingImpressionListener impressionListener) Registers an impression listener with IAM, which will be notified on every IAM impressionvoid
addImpressionListener
(InAppMessagingImpressionListener impressionListener, Executor executor) Registers an impression listener with IAM, which will be notified on every IAM impression, and triggered on the provided executorboolean
Determine whether messages are suppressed or not.void
Remove previously registered display listeners.void
displayInAppMessage
(InAppMessage inAppMessage) static InAppMessaging
Get InAppMessaging instanceReturns the current display component.static InAppMessaging
initialize
(android.app.Application application, com.wonderpush.sdk.InternalEventTracker internalEventTracker, InAppMessaging.InAppMessagingDelegate delegate) Internal method.void
removeClickListener
(InAppMessagingClickListener clickListener) Unregisters a click listenervoid
removeDisplayErrorListener
(InAppMessagingDisplayErrorListener displayErrorListener) Unregisters a display error listenervoid
removeImpressionListener
(InAppMessagingImpressionListener impressionListener) Unregisters an impression listenervoid
setMessageDisplayComponent
(InAppMessagingDisplay messageDisplay) Called to set a new message display component for IAM SDK.void
setMessagesSuppressed
(Boolean areMessagesSuppressed) Enable or disable suppression of In App Messaging messagesvoid
triggerEvent
(String eventType) Tell the in-app messaging SDK that an event of the given type was triggered.
-
Method Details
-
initialize
@NonNull public static InAppMessaging initialize(android.app.Application application, com.wonderpush.sdk.InternalEventTracker internalEventTracker, InAppMessaging.InAppMessagingDelegate delegate) Internal method. -
getInstance
Get InAppMessaging instance -
setMessagesSuppressed
Enable or disable suppression of In App Messaging messagesWhen enabled, no in app messages will be rendered until either you either disable suppression, or the app restarts, as this state is not preserved over app restarts.
By default, messages are not suppressed.
- Parameters:
areMessagesSuppressed
- Whether messages should be suppressed
-
areMessagesSuppressed
public boolean areMessagesSuppressed()Determine whether messages are suppressed or not. This is honored by the UI sdk, which handles rendering the in app message.- Returns:
- true if messages should be suppressed
-
getMessageDisplayComponent
Returns the current display component. Unless you've set your own withsetMessageDisplayComponent(InAppMessagingDisplay)
, this will be the built-in display component.- Returns:
- The current display component.
-
setMessageDisplayComponent
Called to set a new message display component for IAM SDK. This is the method used by both the default IAM display SDK or any app wanting to customize the message display. -
clearDisplayListener
public void clearDisplayListener()Remove previously registered display listeners. -
addImpressionListener
Registers an impression listener with IAM, which will be notified on every IAM impression- Parameters:
impressionListener
-
-
addClickListener
Registers a click listener with IAM, which will be notified on every IAM click- Parameters:
clickListener
-
-
addDisplayErrorListener
public void addDisplayErrorListener(@NonNull InAppMessagingDisplayErrorListener displayErrorListener) Registers a display error listener with IAM, which will be notified on every IAM display error- Parameters:
displayErrorListener
-
-
addImpressionListener
public void addImpressionListener(@NonNull InAppMessagingImpressionListener impressionListener, @NonNull Executor executor) Registers an impression listener with IAM, which will be notified on every IAM impression, and triggered on the provided executor- Parameters:
impressionListener
-executor
-
-
addClickListener
public void addClickListener(@NonNull InAppMessagingClickListener clickListener, @NonNull Executor executor) Registers a click listener with IAM, which will be notified on every IAM click, and triggered on the provided executor- Parameters:
clickListener
-executor
-
-
addDisplayErrorListener
public void addDisplayErrorListener(@NonNull InAppMessagingDisplayErrorListener displayErrorListener, @NonNull Executor executor) Registers a display error listener with IAM, which will be notified on every IAM display error, and triggered on the provided executor- Parameters:
displayErrorListener
-executor
-
-
removeImpressionListener
Unregisters an impression listener- Parameters:
impressionListener
-
-
removeClickListener
Unregisters a click listener- Parameters:
clickListener
-
-
removeDisplayErrorListener
public void removeDisplayErrorListener(@NonNull InAppMessagingDisplayErrorListener displayErrorListener) Unregisters a display error listener- Parameters:
displayErrorListener
-
-
triggerEvent
Tell the in-app messaging SDK that an event of the given type was triggered. Useful for testing.- Parameters:
eventType
-
-
displayInAppMessage
-