Need to configure your backend?See Build a Backend →
App badge count
Use getBadgeCount and setBadgeCount to read and update the number displayed on your application's icon. Call initializePushNotifications() first; see Push notifications.
Get the current badge count
import { getBadgeCount } from 'aws-amplify/push-notifications/customer-profiles';
const badgeCount = await getBadgeCount();getBadgeCount resolves to the current count, or null on a platform that does not support badges.
Set the badge count
import { setBadgeCount } from 'aws-amplify/push-notifications/customer-profiles';
setBadgeCount(3);Set the count to 0 to clear the badge from your application's icon:
import { setBadgeCount } from 'aws-amplify/push-notifications/customer-profiles';
setBadgeCount(0);setBadgeCount is safe to call on a platform that does not support badges. The call is ignored rather than throwing an error.