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

ParameterTypeDefault ValueDescription
idString-Message identifier
priorityInt999Message priority for display ordering
startDateUtcDate?nullMessage start date in UTC
endDateUtcDate?nullMessage end date in UTC
modifiedDateUtcDate?nullLast modification date in UTC
displayLimitInt1Maximum number of times the message can be displayed
displayCountInt0Current count of how many times the message has been displayed
typeInAppMessage.Type-Message type (modal, banner, fullscreen, etc.)
windowColorString?nullWindow background color
displayDurationLong-1Display duration in milliseconds (-1 for indefinite)
backgroundColorString?-Message background color
cornerRadiusInAppMessage.SizeSize.sCorner radius size
layoutOrderInAppMessage.LayoutOrderLayoutOrder.ImageTitleBodyComponent layout order
mediaInAppMessage.Media?nullMedia configuration (image/video)
titleInAppMessage.TextField?nullTitle text field configuration
bodyInAppMessage.TextField?nullBody text field configuration
tertiaryTextInAppMessage.TertiaryTextField?nullTertiary text field with hyperlink support
closeButtonInAppMessage.CloseButton?nullClose button configuration
buttonConfigurationInAppMessage.ButtonConfigButtonConfig.twoUpButton layout configuration
buttonsList<InAppMessage.Button>?nullList of action buttons
messageDelaySecInt0Delay before displaying the message in seconds
displaySuppressionActionList<String>?nullList of actions that suppress message display
shadowInAppMessage.Shadow?nullShadow effect configuration
additionalMarginInAppMessage.Margin?nullAdditional margin spacing
animationInAppMessage.Animation?nullAnimation configuration
borderInAppMessage.Border?nullBorder configuration
appLimitOverrideBooleanfalseOverride app-level display limits
sourceEvent.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 start
  • center - Align to the center
  • end - 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 small
  • s - Small (commonly used default)
  • m - Medium
  • l - Large
  • xl - Extra large
  • xxl - Extra extra large
  • e2e - Edge-to-edge (used in Media.ImageSize)

Text alignment options.

Values:

  • left - Left-aligned
  • center - Center-aligned (default)
  • right - Right-aligned

Message type variants.

Values:

  • modal - Modal dialog message
  • banner - Banner message
  • fullscreen - 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 @JvmField annotation 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 Parcelable for efficient passing between Android components
  • Complete enum value lists may vary; refer to source code for exhaustive options