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

    Class IterableInAppManager

    Manages in-app messages for the current user.

    This class provides methods to interact with in-app messages, including retrieving messages, displaying messages, removing messages, setting read status, and more.

    The inAppManager property of an Iterable instance is set to an instance of this class.

    Index

    Constructors

    Methods

    • Retrieves the current user's list of in-app messages designated for the mobile inbox and stored in the local queue.

      This method does not cause the application to immediately check for new in-app messages on the server, since the SDK keeps the message list in sync.

      Returns Promise<IterableInAppMessage[]>

      A Promise that resolves to an array of messages marked as saveToInbox.

      Iterable.inAppManager.getInboxMessages().then(messages => {
      messages.forEach(message => {
      console.log(JSON.stringify(message, null, 2))
      });
      });
    • Retrieve the current user's list of in-app messages stored in the local queue.

      This method does not cause the application to immediately check for new in-app messages on the server, since the SDK keeps the message list in sync.

      Returns Promise<IterableInAppMessage[]>

      A Promise that resolves to an array of in-app messages.

      Iterable.inAppManager.getMessages().then(messages => {
      messages.forEach(message => {
      console.log(JSON.stringify(message, null, 2))
      });
      });
    • Pause or unpause the automatic display of incoming in-app messages

      If set to false, the SDK will immediately retrieve and process in-app messages from the message queue.

      The default value of isAutoDisplayPaused is false (in the native code).

      Parameters

      • paused: boolean

        Whether the automatic displaying should be paused

      Returns void

      Iterable.inAppManager.setAutoDisplayPaused(paused);
      
    • Renders an in-app message and consumes it from the user's message queue if necessary.

      If you skip showing an in-app message when it arrives, you can show it at another time by calling this method.

      Parameters

      • message: IterableInAppMessage

        The message to show (an IterableInAppMessage object)

      • consume: boolean

        Whether or not the message should be consumed from the user's message queue after being shown. This should be defaulted to true.

      Returns Promise<undefined | string>

      A Promise that resolves to the URL of the button or link the user tapped to close the in-app message.

      Iterable.inAppManager.showMessage(message, false).then(url => {
      console.log("url: " + url)
      });