MessageStream

Class to handle interactions with in-app message stream.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion
Link copied to clipboard

Handler interface for deleting a Message.

Link copied to clipboard
interface MessagesHandler

Handler interface for getting Messages for this device.

Link copied to clipboard

Handler interface for setting messages as read.

Link copied to clipboard

Generic handler for async calls to the Marigold SDK.

Link copied to clipboard

Called on the main thread for an eligible attempt. Complete immediately or within two seconds, from any thread; only the first response is accepted. An unanswered attempt displays SDK UI with app defaults. Cancelled and stale responses are ignored. SUPPRESS and HANDLED create no SDK impression; a custom renderer registers its own.

Properties

Link copied to clipboard

Message Read Flow - subscribe to this to handle events when messages are read on the device.

Link copied to clipboard

Shared, independent snapshots. Null resets app-wide defaults.

Link copied to clipboard

App-wide font aliases for local and payload titleFont/bodyFont names. Register at app startup. Registered aliases take priority over system family names. Blank names are ignored. Maps are copied on input/access; replacing the map affects future presentations only. Fonts are not downloaded or injected into campaign HTML. Empty map clears the aliases.

Link copied to clipboard

Unread Message Count Flow - subscribe to this to handle events when the message unread count is updated on the device.

Functions

Link copied to clipboard

Add a listener to handle when messages are read by the user.

Link copied to clipboard

Add a listener to handle when the unread message count is updated.

Link copied to clipboard

Clear the Message Stream for the device.

Link copied to clipboard

Clear the Message Stream for the device.

Link copied to clipboard

Clear the Message Stream for the device.

Link copied to clipboard

Removes a Message from appearing in a device's message stream. Does nothing if message is null.

Link copied to clipboard
suspend fun MessageStream.deleteMessage(message: Message)

Removes a Message from appearing in a device's message stream.

Link copied to clipboard

Removes a Message from appearing in a device's message stream.

Link copied to clipboard
fun getMessage(messageId: String, messageHandler: MessageStream.MessageStreamHandler<Message>?)

Retrieves a Message for a given Message ID.

Link copied to clipboard
suspend fun MessageStream.getMessage(messageId: String): Message

Retrieves a Message for a given Message ID.

Link copied to clipboard

Retrieves a Message for a given Message ID.

Link copied to clipboard

Retrieve all Messages visible for this device.

Link copied to clipboard

Retrieve all Messages visible for this device.

Link copied to clipboard

Retrieve all Messages visible for this device.

Link copied to clipboard

Asynchronously returns the total number of unread messages in the message stream.

Link copied to clipboard

Get the total number of unread messages in the message stream.

Link copied to clipboard

Get the total number of unread messages in the message stream.

Link copied to clipboard
fun presentMessageDetail(activity: Activity, messageId: String)

Loads the message if needed and asks the detail preparation listener before opening SDK UI. Leaves the host in front if the message is unavailable or the decision suppresses SDK display.

Link copied to clipboard

Creates an impression for a message for a given interaction type.

Removes the listener only if it is still the registered listener.

Link copied to clipboard

Removes the listener only if it is still the registered listener.

Link copied to clipboard

Replaces the synchronous popup listener when non-null. Null restores legacy handling.

Link copied to clipboard

Set the listener to handle taps on the in-app notification banner

Link copied to clipboard

Prepares explicit detail requests independently of automatic popup enablement.

Link copied to clipboard

Convenience method for setMessagesRead().

Link copied to clipboard
suspend fun MessageStream.setMessageRead(message: Message)

Convenience method for setMessagesRead.

Link copied to clipboard

Convenience method for setMessagesRead.

Link copied to clipboard

Marks all given messages as read and triggers an update broadcast to the unread messages count.

Link copied to clipboard
suspend fun MessageStream.setMessagesRead(messages: List<Message>)

Marks all given messages as read and triggers an update broadcast to the unread messages count.

Link copied to clipboard

Marks all given messages as read and triggers an update broadcast to the unread messages count.

Link copied to clipboard

Set the listener to handle In-App notification on display callbacks.

Link copied to clipboard
fun setUnreadMessageCount(unreadMessageCount: Int)