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

Page updated Mar 26, 2026

競合を解決する

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-App Messaging は以下の方法でメッセージを選択します。

  1. キャンペーンの有効期限順にメッセージをソートする
  2. ソートされたトップメッセージを返す(有効期限に最も近いメッセージ)

ただし、これがあなたの競合解決方法ではない場合もあるため、独自の競合ハンドラーを設定することができます。

src/index.js
import { setConflictHandler } from 'aws-amplify/in-app-messaging';
/**
* 競合解決戦略がどのようなものであれ、ハンドラーは常に
* アプリ内メッセージの配列を受け入れ、単一のアプリ内メッセージを返す必要があります。
*/
const myConflictHandler = (messages) => {
// ランダムにメッセージを返す
const randomIndex = Math.floor(Math.random() * messages.length);
return messages[randomIndex];
};
setConflictHandler(myConflictHandler);