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

Page updated Feb 21, 2024

NewDeploy web apps with Git or your AI coding agent using the latest AWS Amplify. Add managed databases and authentication as you grow. Explore the documentation.
Maintenance ModeYou are viewing Amplify Gen 1 documentation. Amplify Gen 1 has entered maintenance mode and will reach end of life on May 1, 2027. For existing Gen 1 projects, a migration guide and tooling are available to help you upgrade.

Add app badge count

These docs cover Amplify Gen 1. For new web apps, we recommend the latest AWS Amplify, with a simplified CLI and native integrations for databases, storage, and AI models. Get started with the latest AWS Amplify.

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.

The app badge count, when set, can be seen on your app's icon on a user's device. Amplify provides you with simple helpers to manipulate this number.

App badge count helpers are safe to call (but will be ignored) even when your app is running on platforms where badges are not supported.

Get the current badge count

Use getBadgeCount to get the current app badge count. You might need to do this to calculate the value when setting the badge count.

import {
getBadgeCount,
GetBadgeCountOutput
} from 'aws-amplify/push-notifications';
const count: GetBadgeCountOutput = await getBadgeCount();
import { getBadgeCount } from 'aws-amplify/push-notifications';
const count = await getBadgeCount();

Update the badge count

Use setBadgeCount to set the current app badge count. Setting the badge count to 0 (zero) will remove the badge from your app's icon.

import {
setBadgeCount,
SetBadgeCountInput
} from 'aws-amplify/push-notifications';
const count: SetBadgeCountInput = 42;
setBadgeCount(count);
import { setBadgeCount } from 'aws-amplify/push-notifications';
const count = 42;
setBadgeCount(count);