The message to display to the user.
How to align message text. See the TextAlignment
enum.
Object of string/string key/value pairs.
The id of the trigger that created this message. The SDK will report back this to Braze with in-app message analytics events.
Where the user should be brought when clicking on this message. See the
ClickAction
enum.
If clickAction
is ClickAction
.URI, the URI to follow when the
user clicks on this message.
If clickAction
is ClickAction
.URI, whether to open clicks
in a new tab/window. See the OpenTarget
enum.
How the message is dismissed, via a timer or requiring interaction from the user.
See the DismissType
enum.
Length of time in milliseconds until auto-dismiss should occur. Only used when
dismissType is DismissType
.AUTO_DISMISS
A Font Awesome unicode string, e.g. "\uf042" to fa-adjust. See the Font Awesome cheatsheet for details.
Url of an image to include in this message. The message will only display an image or an icon, and will prioritize the image if present.
Whether the image should be shown as normal on the top of the in-app message or used
as the entire content of the message. See the ImageStyle
enum.
Color of icon. Hex value with opacity (e.g. 0xff00ff00 is opaque green).
Background color of icon. Hex value with opacity (e.g. 0xff00ff00 is opaque green).
Background color of entire message. Hex value with opacity (e.g. 0xff00ff00 is opaque green).
Text color of message. Hex value with opacity (e.g. 0xff00ff00 is opaque green).
Color of close button. Hex value with opacity (e.g. 0xff00ff00 is opaque green).
Whether to animate the showing of this message.
Whether to animate the hiding of this message.
Header text to
How to align header text. See the TextAlignment
enum.
Color of header text. Hex value with opacity (e.g. 0xff00ff00 is opaque green).
Color of the background frame which blocks page interaction while the message is showing.
Array of up to twoInAppMessageButton
objects.
How to crop and fit images in the allowable space. See the CropType
enum.
The ID to give the parent HTML element that this message is rendered into.
Custom CSS to apply to the page while this element is shown. All selectors should be scoped to the htmlId of this message to prevent restyling elements outside of the message when it is shown.
Whether to animate the showing of this message.
Whether to animate the hiding of this message.
Background color of entire message. Hex value with opacity (e.g. 0xff00ff00 is opaque green).
Array of up to twoInAppMessageButton
objects.
Where the user should be brought when clicking on this message. See the
ClickAction
enum.
Color of close button. Hex value with opacity (e.g. 0xff00ff00 is opaque green).
How to crop and fit images in the allowable space. See the CropType
enum.
Custom CSS to apply to the page while this element is shown. All selectors should be scoped to the htmlId of this message to prevent restyling elements outside of the message when it is shown.
How the message is dismissed, via a timer or requiring interaction from the user.
See the DismissType
enum.
Length of time in milliseconds until auto-dismiss should occur. Only used when
dismissType is DismissType
.AUTO_DISMISS
Object of string/string key/value pairs.
Color of the background frame which blocks page interaction while the message is showing.
Header text to
How to align header text. See the TextAlignment
enum.
Color of header text. Hex value with opacity (e.g. 0xff00ff00 is opaque green).
The ID to give the parent HTML element that this message is rendered into.
A Font Awesome unicode string, e.g. "\uf042" to fa-adjust. See the Font Awesome cheatsheet for details.
Background color of icon. Hex value with opacity (e.g. 0xff00ff00 is opaque green).
Color of icon. Hex value with opacity (e.g. 0xff00ff00 is opaque green).
Whether the image should be shown as normal on the top of the in-app message or used
as the entire content of the message. See the ImageStyle
enum.
Url of an image to include in this message. The message will only display an image or an icon, and will prioritize the image if present.
Whether this message is a ControlMessage.
The message to display to the user.
How to align message text. See the TextAlignment
enum.
If clickAction
is ClickAction
.URI, whether to open clicks
in a new tab/window. See the OpenTarget
enum.
Text color of message. Hex value with opacity (e.g. 0xff00ff00 is opaque green).
The id of the trigger that created this message. The SDK will report back this to Braze with in-app message analytics events.
If clickAction
is ClickAction
.URI, the URI to follow when the
user clicks on this message.
Centers the image in the available space and crops any overflowing edges.
Fits the image within the available space, causing blank space on the shorter axis (e.g. tall images will have bars of blank space on the left/right)
Call this method if you wish to programmatically remove the message from the DOM. This method will only work with the Braze UI.
Remove all event subscriptions from this message.
Remove an event subscription that you previously subscribed to.
The identifier of the subscription you wish to remove, returned by the method you initially used to create it.
Subscribe to receive click events. The subscriber callback will be called whenever this message is clicked by the user.
The callback function to receive click events. This function will be invoked with no arguments when this message records a click.
The identifier of the subscription created. This can be passed to removeSubscription
to cancel the subscription. Returns null if the subscriber passed is not a function.
Subscribe to receive dismissed events. The subscriber callback will be called whenever this message is closed by the user, or when it's dismissed automatically (depending on the dismissType).
The callback function to receive dismissed events. This function will be invoked with no arguments when this message records a dismissal.
The identifier of the subscription created. This can be passed to removeSubscription
to cancel the subscription. Returns null if the subscriber passed is not a function.
A modal in-app message object which can be passed to
showInAppMessage
or handled manually. Subscribe to be notified when in-app messages are triggered viasubscribeToInAppMessage