Amplify JS API Documentation
    Preparing search index...
    • Set a conflict handler that will be used to resolve conflicts that may emerge when matching events with synced messages.

      Parameters

      • input: InAppMessageConflictHandler

        The input object that holds the conflict handler to be used.

      Returns void

      AWS will end support for Amazon Pinpoint on October 30, 2026.

      The conflict handler is not persisted across app restarts and so must be set again before dispatching an event for any custom handling to take effect.

      validation: InAppMessagingValidationErrorCode - Thrown when the provided parameters or library configuration is incorrect, or if In App messaging hasn't been initialized.

      // Sync messages before dispatching an event
      await syncMessages();

      // Example custom conflict handler
      const myConflictHandler = (messages) => {
      // Return a random message
      const randomIndex = Math.floor(Math.random() * messages.length);
      return messages[randomIndex];
      };

      // Set the conflict handler
      setConflictHandler(myConflictHandler);

      // Dispatch an event
      await dispatchEvent({ name: 'test_event' });