@iterable/react-native-sdk - v2.0.3
    Preparing search index...

    Class IterableInboxDataModel

    The IterableInboxDataModel class provides methods to manage and manipulate inbox messages.

    Index

    Constructors

    Properties

    comparatorFn?: (
        message1: IterableInAppMessage,
        message2: IterableInAppMessage,
    ) => number

    Optional comparator function to determine the order of messages.

    Type Declaration

    dateMapperFn?: (message: IterableInAppMessage) => undefined | string

    Optional 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.

    Type Declaration

      • (message: IterableInAppMessage): undefined | string
      • Parameters

        Returns undefined | string

        A string representing the date or undefined if no date is available.

    filterFn?: (message: IterableInAppMessage) => boolean

    Optional 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.

    Type Declaration

    Methods

    • Sets the filter, comparator, and date mapper functions for the inbox data model.

      Parameters

      • Optionalfilter: (message: IterableInAppMessage) => boolean

        A function to filter messages. It takes an IterableInAppMessage as an argument and returns a boolean indicating whether the message should be included.

      • Optionalcomparator: (message1: IterableInAppMessage, message2: IterableInAppMessage) => number

        A function to compare two messages. It takes two IterableInAppMessage objects as arguments and returns a number indicating their relative order.

      • OptionaldateMapper: (message: IterableInAppMessage) => undefined | string

        A 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.

      Returns void

    • Marks a message as read in the Iterable inbox.

      Parameters

      • id: string

        The unique identifier of the message to be marked as read.

      Returns void

    • 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?)

      Parameters

      • visibleRows: IterableInboxImpressionRowInfo[] = []

        An array of IterableInboxImpressionRowInfo objects representing the rows that are currently visible. Defaults to an empty array if not provided.

      Returns void