Optional
comparatorOptional comparator function to determine the order of messages.
The first message to compare.
The second message to compare.
A negative number if message1
should come before message2
,
a positive number if message1
should come after message2
,
or 0 if they are considered equal.
Optional
dateOptional function to map an IterableInAppMessage to a date string or undefined. This function can be used to extract and format the date from a message.
The IterableInAppMessage object to be mapped.
A string representing the date or undefined if no date is available.
Optional
filterOptional function to filter messages.
This function takes an IterableInAppMessage
as an argument and returns a boolean value.
It is used to determine whether a given message should be included based on custom criteria.
The in-app message to be evaluated.
A boolean indicating whether the message meets the filter criteria.
Deletes an item from the inbox by its ID.
The unique identifier of the item to be deleted.
The source from which the delete action is initiated.
Ends the current tracking session and updates the visible rows.
An array of IterableInboxImpressionRowInfo
objects representing the rows that are currently visible. Defaults to an empty array.
A promise that resolves when the session has ended and the visible rows have been updated.
Formats the creation date of an in-app message.
The in-app message object containing the creation date.
The formatted date string. Returns an empty string if the creation date is undefined.
Retrieves the HTML content for a given message ID.
The ID of the message to retrieve HTML content for.
A promise that resolves to the HTML content of the specified message.
Refreshes the inbox data by fetching the latest messages from Iterable.
A promise that resolves to an array of processed inbox row view models. If the fetch operation fails, the promise resolves to an empty array.
Sets the filter, comparator, and date mapper functions for the inbox data model.
Optional
filter: (message: IterableInAppMessage) => booleanA function to filter messages. It takes an IterableInAppMessage
as an argument and returns a boolean indicating whether the message should be included.
Optional
comparator: (message1: IterableInAppMessage, message2: IterableInAppMessage) => numberA function to compare two messages. It takes two IterableInAppMessage
objects as arguments and returns a number indicating their relative order.
Optional
dateMapper: (message: IterableInAppMessage) => undefined | stringA function to map a message to a date string. It takes an IterableInAppMessage
as an argument and returns a string representing the date, or undefined if no date is applicable.
Marks a message as read in the Iterable inbox.
The unique identifier of the message to be marked as read.
Starts a tracking session for the inbox with the given visible rows.
An array of IterableInboxImpressionRowInfo
objects representing the rows that are currently visible.
Updates the visible rows in the inbox.
This method takes an array of IterableInboxImpressionRowInfo
objects
representing the rows that are currently visible and updates the
visibility status. (REVIEW: Where does it update it? In Iterable or in the
interface?)
An array of IterableInboxImpressionRowInfo
objects
representing the rows that are currently visible.
Defaults to an empty array if not provided.
The
IterableInboxDataModel
class provides methods to manage and manipulate inbox messages.