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
1data class InAppMessageCloseAction(
2 val actionType: InAppMessageCloseAction.InAppMessageDismissReason,
3 val id: String?
4)A data class that represents how an in-app message was closed, including the dismiss reason and an optional identifier.
This class is used in the didCloseMessage callback to inform the host application about the manner in which a message was dismissed—whether through auto-dismiss, a close control, or a button tap.
| Parameter | Type | Description |
|---|---|---|
actionType | InAppMessageDismissReason | The reason why the message was closed |
id | String? | Optional identifier (e.g., button ID when dismissed via BUTTON); null otherwise |
1constructor(
2 actionType: InAppMessageCloseAction.InAppMessageDismissReason,
3 id: String?
4)Creates an instance of InAppMessageCloseAction with the specified dismiss reason and optional ID.
1val actionType: InAppMessageCloseAction.InAppMessageDismissReasonThe reason the in-app message was dismissed.
1val id: String?Optional identifier associated with the close action. Contains a button ID when the message is closed via the BUTTON dismiss reason; null for other dismiss reasons.
1object CompanionCompanion object for InAppMessageCloseAction.
1enum InAppMessageDismissReason : Enum<InAppMessageCloseAction.InAppMessageDismissReason>An enumeration representing the possible reasons an in-app message was dismissed.
Enum Values:
BUTTON - Message was dismissed by tapping a buttonThis class is typically received in the InAppMessageManager.EventListener.didCloseMessage callback:
1override fun didCloseMessage(closeAction: InAppMessageCloseAction) {
2 when (closeAction.actionType) {
3 InAppMessageDismissReason.BUTTON -> {
4 // Handle button tap with closeAction.id
5 }
6 // Handle other dismiss reasons
7 }
8}