A slide-up in-app message object which can be passed to showInAppMessage
or handled manually. Subscribe to be notified when in-app messages are triggered via subscribeToInAppMessage
The message to display to the user.
How to align message text. See the TextAlignment
enum.
Where the message should slide in from. See the SlideFrom
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.
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.
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).
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).
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.
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).
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.
Where the message should slide in from. See the SlideFrom
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 slide-up in-app message object which can be passed to
showInAppMessage
or handled manually. Subscribe to be notified when in-app messages are triggered viasubscribeToInAppMessage