InAppMessageCloseAction
InAppMessagingFeature
InAppMessagingFeatureInitializationStatus
DID THIS ARTICLE SOLVE YOUR ISSUE?
Let us know so we can improve!
Let us know so we can improve!
Package: com.salesforce.marketingcloud.inappmessagingfeature
Module: In App Messaging Feature Module v1.0.0
SDK: Salesforce Marketing Cloud Unified SDK 11.0.0
1class InAppMessagingFeature : ModuleInterfaceThe InAppMessagingFeature class provides comprehensive functionality for managing in-app messages and related features within the Salesforce Marketing Cloud SDK.
Since: 1.0.0
This class is thread-safe and uses atomic operations for state management. All public methods can be called from any thread.
1// Access the InAppMessagingFeature asynchronously
2InAppMessagingFeature.requestSdk { inAppMessagingFeature ->
3 val manager = inAppMessagingFeature.getInAppMessageManager()
4
5 // Set a listener to control message display
6 manager.setInAppMessageListener(object : InAppMessageManager.EventListener {
7 override fun shouldShowMessage(message: InAppMessage): Boolean {
8 // Return true to display the message, false to suppress it
9 return true
10 }
11
12 override fun didShowMessage(message: InAppMessage) {
13 // Called when the message is displayed on screen
14 }
15
16 override fun didCloseMessage(message: InAppMessage, action: InAppMessageCloseAction) {
17 // Called when the message is dismissed
18 }
19 })
20}1object Companion1open override val state: JSONObjectReturns the current state of the InAppMessagingFeature module as a JSONObject.
1fun getConfig(): InAppMessagingFeatureConfigGets the configuration used to initialize this InAppMessagingFeature instance.
Returns: InAppMessagingFeatureConfig
1fun getInAppMessageManager(): InAppMessageManagerGets the In-App Message Manager for managing in-app messages.
Returns: InAppMessageManager
1fun getInitializationStatus(): InAppMessagingFeatureInitializationStatus?Gets the initialization status of this InAppMessagingFeature instance.
Returns: InAppMessagingFeatureInitializationStatus?
1fun isTornDown(): BooleanChecks if the InAppMessagingFeature instance is torn down.
Returns: Boolean
Target: androidJvm