InAppMessage
InAppMessage is a data class in the Salesforce Marketing Cloud Unified SDK that represents an in-app message configuration. It implements the Android Parcelable interface for efficient serialization.
Package: com.salesforce.marketingcloud.inappmessaging.models
Module: inappmessagingmodelsmodule
Version: 1.0.0
SDK Version: 11.0
| Parameter | Type | Default Value | Description |
|---|---|---|---|
id | String | - | Message identifier |
priority | Int | 999 | Message priority for display ordering |
startDateUtc | Date? | null | Message start date in UTC |
endDateUtc | Date? | null | Message end date in UTC |
modifiedDateUtc | Date? | null | Last modification date in UTC |
displayLimit | Int | 1 | Maximum number of times the message can be displayed |
displayCount | Int | 0 | Current count of how many times the message has been displayed |
type | InAppMessage.Type | - | Message type (modal, banner, fullscreen, etc.) |
windowColor | String? | null | Window background color |
displayDuration | Long | -1 | Display duration in milliseconds (-1 for indefinite) |
backgroundColor | String? | - | Message background color |
cornerRadius | InAppMessage.Size | Size.s | Corner radius size |
layoutOrder | InAppMessage.LayoutOrder | LayoutOrder.ImageTitleBody | Component layout order |
media | InAppMessage.Media? | null | Media configuration (image/video) |
title | InAppMessage.TextField? | null | Title text field configuration |
body | InAppMessage.TextField? | null | Body text field configuration |
tertiaryText | InAppMessage.TertiaryTextField? | null | Tertiary text field with hyperlink support |
closeButton | InAppMessage.CloseButton? | null | Close button configuration |
buttonConfiguration | InAppMessage.ButtonConfig | ButtonConfig.twoUp | Button layout configuration |
buttons | List<InAppMessage.Button>? | null | List of action buttons |
messageDelaySec | Int | 0 | Delay before displaying the message in seconds |
displaySuppressionAction | List<String>? | null | List of actions that suppress message display |
shadow | InAppMessage.Shadow? | null | Shadow effect configuration |
additionalMargin | InAppMessage.Margin? | null | Additional margin spacing |
animation | InAppMessage.Animation? | null | Animation configuration |
border | InAppMessage.Border? | null | Border configuration |
appLimitOverride | Boolean | false | Override app-level display limits |
source | Event.Producer | - | Event producer source |
All constructor parameters are exposed as public properties with the @JvmField annotation, making them directly accessible from both Kotlin and Java code.
Component functions for destructuring the data class.
Creates a copy of the instance with optional parameter modifications.
Compares this instance with another object for equality.
Returns a hash code value for the object.
Returns a string representation of the object.
Describe the kinds of special objects contained in this Parcelable instance.
Flatten this object into a Parcel.
Used by the Android framework for parceling and unparceling InAppMessage instances.
Defines component alignment options.
Values:
start- Align to the startcenter- Align to the centerend- Align to the end
Defines button layout configurations.
Values:
twoUp- Two-button layout (default)- Additional values may be available
Defines media content scaling modes.
Values:
fill- Fill the container (default)fit- Fit within the container- Additional values may be available
Defines the order of message components.
Values:
ImageTitleBody- Image, then title, then body (default)- Additional values may be available
Predefined size values for various styling properties.
Values:
xs- Extra smalls- Small (commonly used default)m- Mediuml- Largexl- Extra largexxl- Extra extra largee2e- Edge-to-edge (used in Media.ImageSize)
Text alignment options.
Values:
left- Left-alignedcenter- Center-aligned (default)right- Right-aligned
Message type variants.
Values:
modal- Modal dialog messagebanner- Banner messagefullscreen- Fullscreen message- Additional values may be available
Animation settings for the in-app message.
Border styling configuration.
Action button configuration.
Close button configuration.
Font configuration.
Spacing configuration for all sides.
Image or video media configuration.
Shadow effect configuration.
Basic text field configuration.
Text field with hyperlink support, extends TextField functionality.
- All properties use
@JvmFieldannotation for direct Java interoperability - Color values can be specified as hex strings (e.g., “#FFFFFF”) or named colors
- Nullable properties allow for flexible configuration
- Default values are provided for most styling properties
- The class implements
Parcelablefor efficient passing between Android components - Complete enum value lists may vary; refer to source code for exhaustive options