InAppMessagingFeature

class InAppMessagingFeature : ModuleInterface

The InAppMessagingFeature Class

This class provides comprehensive functionality for in app messages and related features within the Salesforce Marketing Cloud SDK.

Key Features:

  • Displaying in-app messages triggered by marketing campaigns
  • Controlling message display with an event listener
  • Customizing message appearance with typeface and status bar color
  • Programmatically showing previously blocked messages

Thread Safety: This class is thread-safe and uses atomic operations for state management. All public methods can be called from any thread.

Example Usage:

// Access the InAppMessagingFeature asynchronously
InAppMessagingFeature.requestSdk { inAppMessagingFeature ->
val manager = inAppMessagingFeature.getInAppMessageManager()

// Set a listener to control message display
manager.setInAppMessageListener(object : InAppMessageManager.EventListener {
override fun shouldShowMessage(message: InAppMessage): Boolean {
// Return true to display the message, false to suppress it
return true
}

override fun didShowMessage(message: InAppMessage) {
// Called when the message is displayed on screen
}

override fun didCloseMessage(message: InAppMessage, action: InAppMessageCloseAction) {
// Called when the message is dismissed
}
})
}

Since

1.0.0

See also

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val state: JSONObject

Returns the current state of the InAppMessagingFeature module as a JSONObject.

Functions

Link copied to clipboard

Gets the configuration used to initialize this InAppMessagingFeature instance.

Link copied to clipboard

Gets the In-App Message Manager for managing in-app messages.

Link copied to clipboard

Gets the initialization status of this InAppMessagingFeature instance.

Link copied to clipboard

Checks if the InAppMessagingFeature instance is torn down.