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

    Class IterableEmbeddedManager

    Manages embedded messages from Iterable.

    Provides embedded message functionality including retrieving messages, displaying messages, removing messages, and more.

    Documentation

    Index

    Constructors

    Accessors

    Methods

    • Ends a session.

      When a user leaves a screen in your app where embedded messages are displayed, the session should be ended. This causes the SDK to send session an impression data back to the server.

      A session is tracked when it is ended, so you should be able to find tracking data after this method is called.

      Returns any

      Iterable.embeddedManager.endSession();
      
    • Retrieves a list of embedded messages the user is eligible to see.

      Parameters

      • placementIds: number[] | null

        The placement IDs to retrieve messages for.

      Returns Promise<IterableEmbeddedMessage[]>

      A Promise that resolves to an array of embedded messages.

      Iterable.embeddedManager.getMessages([1, 2, 3]).then(messages => {
      console.log('Messages:', messages);
      });
    • Handles a click on an embedded message.

      This will fire the correct handlers set in the config, and will track the click. It should be use on either a button click or a click on the message itself.

      Parameters

      Returns void

      Iterable.embeddedManager.handleClick(message, buttonId, clickedUrl);
      
    • Pauses an embedded impression.

      An impression represents the on-screen appearances of a given embedded message, in context of a session.

      And impression should be paused when the message is no longer visible, including when your app goes to the background.

      Parameters

      • messageId: string

      Returns any

      Iterable.embeddedManager.pauseImpression(messageId);
      
    • Starts an embedded impression.

      An impression represents the on-screen appearances of a given embedded message, in context of a session.

      Each impression tracks:

      • The total number of times a message appears during a session.
      • The total amount of time that message was visible, across all its appearances in the session.

      Be sure to start and pause impressions when your app goes to and from the background, too.

      Parameters

      • messageId: string
      • placementId: number

      Returns any

      Iterable.embeddedManager.startImpression(messageId, placementId);
      
    • Starts a session.

      A session is a period of time when a user is on a screen or page that can display embedded messages.

      When a user comes to a screen or page in your app where embedded messages are displayed (in one or more placements), a session should be started.

      Returns any

      Iterable.embeddedManager.startSession();
      
    • Syncs embedded local cache with the server.

      When your app first launches, and each time it comes to the foreground, Iterable's Native SDKs automatically refresh a local, on-device cache of embedded messages for the signed-in user. These are the messages the signed-in user is eligible to see.

      At key points during your app's lifecycle, you may want to manually refresh your app's local cache of embedded messages. For example, as users navigate around, on pull-to-refresh, etc.

      However, do not poll for new embedded messages at a regular interval.

      Returns any

      IterableEmbeddedManager.syncMessages();
      
    • Tracks a click on an embedded message.

      This is called internally when Iterable.embeddedManager.handleClick is called. However, if you want to implement your own click handling, you can use this method to track the click you implement.

      Parameters

      • message: IterableEmbeddedMessage

        The embedded message.

      • buttonId: string | null

        The button ID.

      • clickedUrl: string | null

        The clicked URL.

      Returns any

      Iterable.embeddedManager.trackClick(message, buttonId, clickedUrl);