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

ユーザーの識別

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.

このコールは、ユーザーについて指定した情報をAmazon Pinpointに送信します。これは認証されていない(ゲスト)ユーザーまたは認証されたユーザーのいずれかの場合があります。

Authカテゴリドキュメントに従って、Amplify Authカテゴリから現在のユーザーのIDを取得できます。以下に示すようにセットする前に、それを準備しておいてください(詳細な説明については認証ファーストステップガイドを確認してください)。

位置情報へのアクセスを要求して許可を受けた場合、UserProfileLocationでもそれを提供できます

v0からv1への重大な変更:

元のAnalyticsUserProfileAnalyticsUserProfileLocationクラスのAnalyticsプレフィックスが削除されました。さらに、AnalyticsPropertiesCustomPropertiesに名前が変更されました。

Future<void> addAnalyticsWithLocation({
required String userId,
required String name,
required String email,
required String phoneNumber,
required int age,
}) async {
final userProfile = UserProfile(
name: name,
email: email,
location: const UserProfileLocation(
latitude: 47.606209,
longitude: -122.332069,
postalCode: '98122',
city: 'Seattle',
region: 'WA',
country: 'USA',
),
customProperties: CustomProperties()
..addStringProperty('phoneNumber', phoneNumber)
..addIntProperty('age', age),
);
await Amplify.Analytics.identifyUser(
userId: userId,
userProfile: userProfile,
);
}

ユーザー情報を送信することで、ユーザーをそのユーザープロフィールとアプリ内のアクティビティまたはアクションに関連付けることができます。ユーザーのアクション属性は、同じuserIdを使用することで、デバイスとプラットフォーム全体で追跡することもできます。

ユーザーを識別し、関連するアプリアクティビティを識別するシナリオの例は以下の通りです:

  • ユーザーがアプリのサインアップを完了した場合
  • ユーザーがサインインプロセスを完了した場合
  • ユーザーがアプリを起動した場合
  • ユーザーがユーザープロフィールを変更または更新した場合