Name:
interface
Value:
Extend your Amplify Gen 2 app with AWS Blocks — self-contained backend capabilities you compose into your existing backend.

Choose your framework/language

Gen1 DocsLegacy

Page updated Mar 25, 2026

Clear messages

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.

Once messages have been synced to your user's device, clearMessages() can be used to clear the synced messages.

src/index.js
import { clearMessages } from 'aws-amplify/in-app-messaging';
await clearMessages();

Note: If your app has authentication implemented, we recommend calling clearMessages() in between user log-ins to remove messages targeted for specific user segments. This is especially important if you anticipate your application will be used in shared device scenarios.