Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

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

Page updated Apr 29, 2024

Identify a user

To fully harness the potential of In-App Messaging, you must segment and target your In-App Messaging campaigns to specific user subsets. By identifying users with additional information, including their device demographics, location and any attributes of your choosing, you will be able to display intelligent, targeted in-app messages to the right users.

const userInfo = {
attributes: {
// E.g. hobbies: ['cooking', 'knitting'],
},
demographic: {
appVersion: '',
locale: '', // E.g. en_US
make: '', // E.g. Apple
model: '', // E.g. iPhone
modelVersion: '', // E.g. 13
platform: '', // E.g. iOS
platformVersion: '', // E.g. 15
timezone: '' // E.g. Americas/Los_Angeles
},
location: {
city: '', // E.g. Seattle
country: '', // E.g. US,
postalCode: '', // E.g. 98121
region: '', // E.g. WA
latitude: 0.0,
longitude: 0.0
},
metrics: {
// E.g. logins: 157
}
};
await InAppMessaging.identifyUser('some-user-id', userInfo);

Identify a user with Amazon Pinpoint

When using identifyUser with Amazon Pinpoint, you can configure the address and optOut properties in addition to the other user info properties.

const userInfo = {
address: '' // E.g. A device token or email address
optOut: '' // Either ALL or NONE
};
await InAppMessaging.identifyUser('some-user-id', userInfo);