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

Page updated May 21, 2024

Identify user to Amazon Pinpoint

Amplify Flutter v1 is now in Maintenance Mode until April 30th, 2025. This means that we will continue to include updates to ensure compatibility with backend services and security. No new features will be introduced in v1.

Please use the latest version (v2) of Amplify Flutter to get started.

If you are currently using v1, follow these instructions to upgrade to v2.

This call identifies the current user (which could be unauthenticated or authenticated) to Amazon Pinpoint. The user ID can be any string which identifies the user in the context of your application.

Get the user ID from Amplify Auth

If the user is signed in through Amplify.Auth.signIn, then you can retrieve the current user's ID as shown below:

final user = await Amplify.Auth.getCurrentUser();
final userId = user.userId

Identify the user to Amazon Pinpoint

Once you have a string that identifies the current user (either from the Auth category as shown above or through your own application logic), you can identify the user to Amazon Pinpoint with the following:

final userProfile = AWSPinpointUserProfile(
userAttributes: {
'hobbies': ['cooking', 'knitting']
},
);
await Amplify.Notifications.Push.identifyUser(
userId: userId,
userProfile: userProfile,
);