Name:
interface
Value:
Amplify has re-imagined the way frontend developers build fullstack applications. Develop and deploy without the hassle.

Page updated Apr 16, 2024

Resolve conflicts

AWS will end support for Amazon Pinpoint on October 30, 2026,, and is no longer accepting any new users as of May 20 (see the linked doc). The guidance is to use AWS End User Messaging for push notifications and SMS, Amazon Simple Email Service for sending emails, Amazon Connect for campaigns, journeys, endpoints, and engagement analytics. Pinpoint recommends Amazon Kinesis for event collection and mobile analytics.

In the rare case where an event is sent and meets the criteria set forth by multiple in-app messages, the library needs to decide which message to return. If such a conflict should arise, In-App Messaging will choose a message by:

  1. Sorting the messages in order of campaign expiration
  2. Returning the top message sorted (the closest message to expiry)

However, this may not be how you wish to resolve such conflicts so you may want to set your own conflict handler.

src/index.js
import { setConflictHandler } from 'aws-amplify/in-app-messaging';
/**
* Regardless of your conflict resolution strategy the handler must always accept
* an array of in-app messages and return a single in-app message.
*/
const myConflictHandler = (messages) => {
// Return a random message
const randomIndex = Math.floor(Math.random() * messages.length);
return messages[randomIndex];
};
setConflictHandler(myConflictHandler);