---
description: Capacitor plugin to access and update the badge number of the app icon. It supports setting, clearing, and checking badge counts.
title: Capacitor Badge Plugin for Android, iOS & Web - Capawesome
image: https://capawesome.io/docs/assets/images/social/plugins/badge.png
---

[ Skip to content](#capawesomecapacitor-badge) 

[ 🎉 Introducing **Capawesome Platform** — one platform for Live Updates, Native Builds, App Store Publishing, and Insider SDKs.](https://capawesome.io) 

* [  iOS ](#ios)
* [  Configuration ](#configuration)
* [  Demo ](#demo)
* [  Usage ](#usage)
* [  API ](#api)
* [  Type Aliases ](#type-aliases)
* [  Quirks ](#quirks)
* [  Changelog ](#changelog)
* [  License ](#license)
* [  Credits ](#credits)
* [  Barometer ](/docs/plugins/barometer/)
* [  Biometrics ](/docs/plugins/biometrics/)
* [  Bluetooth Low Energy ](/docs/plugins/bluetooth-low-energy/)
* [  Cloudinary ](/docs/plugins/cloudinary/)
* [  Contacts ](/docs/plugins/contacts/)
* [  Datetime Picker ](/docs/plugins/datetime-picker/)
* [  File Compressor ](/docs/plugins/file-compressor/)
* [  File Opener ](/docs/plugins/file-opener/)
* [  File Picker ](/docs/plugins/file-picker/)
* [  Firebase ](/docs/plugins/firebase/)
* [  Formbricks ](/docs/plugins/formbricks/)
* [  Geocoder ](/docs/plugins/geocoder/)
* [  Google Sign-In ](/docs/plugins/google-sign-in/)
* [  Grafana Faro ](/docs/plugins/grafana-faro/)
* [  libSQL ](/docs/plugins/libsql/)
* [  Live Update ](/docs/plugins/live-update/)
* [  Managed Configurations ](/docs/plugins/managed-configurations/)
* [  Media Session ](/docs/plugins/media-session/)
* [  ML Kit ](/docs/plugins/mlkit/)
* [  Navigation Bar ](/docs/plugins/navigation-bar/)
* [  NFC ](/docs/plugins/nfc/)
* [  OAuth ](/docs/plugins/oauth/)
* [  Pedometer ](/docs/plugins/pedometer/)
* [  Photo Editor ](/docs/plugins/photo-editor/)
* [  PostHog ](/docs/plugins/posthog/)
* [  Printer ](/docs/plugins/printer/)
* [  Purchases ](/docs/plugins/purchases/)
* [  RealtimeKit ](/docs/plugins/realtimekit/)
* [  Screen Orientation ](/docs/plugins/screen-orientation/)
* [  Screenshot ](/docs/plugins/screenshot/)
* [  Secure Preferences ](/docs/plugins/secure-preferences/)
* [  Speech Recognition ](/docs/plugins/speech-recognition/)
* [  Speech Synthesis ](/docs/plugins/speech-synthesis/)
* [  Share Target ](/docs/plugins/share-target/)
* [  Square Mobile Payments ](/docs/plugins/square-mobile-payments/)
* [  SQLite ](/docs/plugins/sqlite/)
* [  Superwall ](/docs/plugins/superwall/)
* [  Torch ](/docs/plugins/torch/)
* [  Wifi ](/docs/plugins/wifi/)
* [  Zip ](/docs/plugins/zip/)
* [  Cloud ](/docs/cloud/)
* [  Live Updates ](/docs/cloud/live-updates/)
* Advanced
* Integrations
* [  Native Builds ](/docs/cloud/native-builds/)
* [  Configuration ](/docs/cloud/native-builds/configuration/)
* [  Environments ](/docs/cloud/native-builds/environments/)
* Guides
* [  Sample Projects ](/docs/cloud/native-builds/sample-projects/)
* [  Troubleshooting ](/docs/cloud/native-builds/troubleshooting/)
* [  Automations ](/docs/cloud/automations/)
* [  Assist ](/docs/cloud/assist/)
* Account
* Organizations
* [  Organization and User Management ](/docs/cloud/organizations/memberships/)
* [  Single Sign-On (SSO) ](/docs/cloud/organizations/sso/)
* [  Teams ](/docs/cloud/organizations/teams/)
* [  Two-Factor Authentication ](/docs/cloud/organizations/two-factor-authentication/)
* [  Integrations ](/docs/cloud/integrations/)
* [  License Keys ](/docs/cloud/license-keys/)
* [  Webhooks ](/docs/cloud/webhooks/)
* [  Pricing ](https://capawesome.io/pricing/)
* [  FAQ ](/docs/cloud/faq/)
* [  Support ](/docs/cloud/support/)
* [  Contributing ](/docs/contributing/)
* [  LLMs ](/docs/llms/)
* [  Insiders ](/docs/insiders/)
* [  License ](https://capawesome.io/legal/eula/)
* [  Support ](/docs/insiders/support/)
* [  FAQ ](/docs/insiders/faq/)
* [  Blog ](/blog/)
* Categories

* [  iOS ](#ios)
* [  Configuration ](#configuration)
* [  Demo ](#demo)
* [  Usage ](#usage)
* [  API ](#api)
* [  Type Aliases ](#type-aliases)
* [  Quirks ](#quirks)
* [  Changelog ](#changelog)
* [  License ](#license)
* [  Credits ](#credits)

# @capawesome/capacitor-badge[¶](#capawesomecapacitor-badge "Permanent link")

Capacitor plugin to access and update the badge number of the app icon.

[ ![Deliver Live Updates to your Capacitor app with Capawesome Cloud](../../assets/external/cloud.capawesome.io/assets/banners/cloud-build-and-deploy-capacitor-apps.69628c3f.png) ](https://cloud.capawesome.io/) 

## Features[¶](#features "Permanent link")

We are proud to offer one of the most complete and feature-rich Capacitor plugins for app icon badge management. Here are some of the key features:

* 🖥️ **Cross-platform**: Supports Android, iOS, and Web (PWA).
* 🔢 **Badge management**: Get, set, increase, decrease, and clear badge counts.
* 💾 **Persistent badges**: Badge count persists after reboot or app restart.
* 🔄 **Auto-clear option**: Automatically reset counter when resuming the app.
* 🔐 **Permission handling**: Check and request badge display permissions.
* ⚙️ **Configurable**: Customize persistence and auto-clear behaviors.
* 🔁 **Up-to-date**: Always supports the latest Capacitor version.

Missing a feature? Just [open an issue](https://github.com/capawesome-team/capacitor-plugins/issues) and we'll take a look!

## Newsletter[¶](#newsletter "Permanent link")

Stay up to date with the latest news and updates about the Capawesome, Capacitor, and Ionic ecosystem by subscribing to our [Capawesome Newsletter](https://cloud.capawesome.io/newsletter/).

## Compatibility[¶](#compatibility "Permanent link")

| Plugin Version | Capacitor Version | Status         |
| -------------- | ----------------- | -------------- |
| 8.x.x          | \>=8.x.x          | Active support |
| 7.x.x          | 7.x.x             | Deprecated     |
| 6.x.x          | 6.x.x             | Deprecated     |
| 5.x.x          | 5.x.x             | Deprecated     |

## Installation[¶](#installation "Permanent link")

You can use our **AI-Assisted Setup** to install the plugin. Add the [Capawesome Skills](https://github.com/capawesome-team/skills) to your AI tool using the following command:

`[](#%5F%5Fcodelineno-0-1)npx skills add capawesome-team/skills --skill capacitor-plugins
`

Then use the following prompt:

`` [](#%5F%5Fcodelineno-1-1) Use the `capacitor-plugins` skill from `capawesome-team/skills` to install the `@capawesome/capacitor-badge` plugin in my project.
 ``

If you prefer **Manual Setup**, install the plugin by running the following commands and follow the platform-specific instructions below:

`[](#%5F%5Fcodelineno-2-1)npm install @capawesome/capacitor-badge
[](#%5F%5Fcodelineno-2-2)npx cap sync
`

### Android[¶](#android "Permanent link")

#### Variables[¶](#variables "Permanent link")

If needed, you can define the following project variable in your app’s `variables.gradle` file to change the default version of the dependency:

* `$shortcutBadgerVersion` version of `me.leolin:ShortcutBadger` (default: `1.1.22`)

This can be useful if you encounter dependency conflicts with other plugins in your project.

### iOS[¶](#ios "Permanent link")

#### Privacy manifest[¶](#privacy-manifest "Permanent link")

Add the `NSPrivacyAccessedAPICategoryUserDefaults` dictionary key to your [Privacy Manifest](https://capacitorjs.com/docs/ios/privacy-manifest) (usually `ios/App/PrivacyInfo.xcprivacy`):

`[](#%5F%5Fcodelineno-3-1)<?xml version="1.0" encoding="UTF-8"?>
[](#%5F%5Fcodelineno-3-2)<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
[](#%5F%5Fcodelineno-3-3)<plist version="1.0">
[](#%5F%5Fcodelineno-3-4)  <dict>
[](#%5F%5Fcodelineno-3-5)    <key>NSPrivacyAccessedAPITypes</key>
[](#%5F%5Fcodelineno-3-6)    <array>
[](#%5F%5Fcodelineno-3-7)      <!-- Add this dict entry to the array if the file already exists. -->
[](#%5F%5Fcodelineno-3-8)      <dict>
[](#%5F%5Fcodelineno-3-9)        <key>NSPrivacyAccessedAPIType</key>
[](#%5F%5Fcodelineno-3-10)        <string>NSPrivacyAccessedAPICategoryUserDefaults</string>
[](#%5F%5Fcodelineno-3-11)        <key>NSPrivacyAccessedAPITypeReasons</key>
[](#%5F%5Fcodelineno-3-12)        <array>
[](#%5F%5Fcodelineno-3-13)          <string>CA92.1</string>
[](#%5F%5Fcodelineno-3-14)        </array>
[](#%5F%5Fcodelineno-3-15)      </dict>
[](#%5F%5Fcodelineno-3-16)    </array>
[](#%5F%5Fcodelineno-3-17)  </dict>
[](#%5F%5Fcodelineno-3-18)</plist>
`

## Configuration[¶](#configuration "Permanent link")

These configuration values are available:

| Prop          | Type    | Description                                                                                                                                                                  | Default |
| ------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
| **persist**   | boolean | Configure whether the plugin should restore the counter after a reboot or app restart. Only available on Android and iOS.                                                    | true    |
| **autoClear** | boolean | Configure whether the plugin should reset the counter after resuming the application. On **iOS**, this will also clear all notifications. Only available on Android and iOS. | false   |

### Examples[¶](#examples "Permanent link")

In `capacitor.config.json`:

`[](#%5F%5Fcodelineno-4-1){
[](#%5F%5Fcodelineno-4-2)  "plugins": {
[](#%5F%5Fcodelineno-4-3)    "Badge": {
[](#%5F%5Fcodelineno-4-4)      "persist": true,
[](#%5F%5Fcodelineno-4-5)      "autoClear": false
[](#%5F%5Fcodelineno-4-6)    }
[](#%5F%5Fcodelineno-4-7)  }
[](#%5F%5Fcodelineno-4-8)}
`

In `capacitor.config.ts`:

`[](#%5F%5Fcodelineno-5-1)/// <reference types="@capawesome/capacitor-badge" />
[](#%5F%5Fcodelineno-5-2)
[](#%5F%5Fcodelineno-5-3)import { CapacitorConfig } from '@capacitor/cli';
[](#%5F%5Fcodelineno-5-4)
[](#%5F%5Fcodelineno-5-5)const config: CapacitorConfig = {
[](#%5F%5Fcodelineno-5-6)  plugins: {
[](#%5F%5Fcodelineno-5-7)    Badge: {
[](#%5F%5Fcodelineno-5-8)      persist: true,
[](#%5F%5Fcodelineno-5-9)      autoClear: false,
[](#%5F%5Fcodelineno-5-10)    },
[](#%5F%5Fcodelineno-5-11)  },
[](#%5F%5Fcodelineno-5-12)};
[](#%5F%5Fcodelineno-5-13)
[](#%5F%5Fcodelineno-5-14)export default config;
`

## Demo[¶](#demo "Permanent link")

A working example can be found here: [robingenz/capacitor-plugin-demo](https://github.com/robingenz/capacitor-plugin-demo)

## Usage[¶](#usage "Permanent link")

`[](#%5F%5Fcodelineno-6-1)import { Badge } from '@capawesome/capacitor-badge';
[](#%5F%5Fcodelineno-6-2)
[](#%5F%5Fcodelineno-6-3)const get = async () => {
[](#%5F%5Fcodelineno-6-4)  const result = await Badge.get();
[](#%5F%5Fcodelineno-6-5)  return result.count;
[](#%5F%5Fcodelineno-6-6)};
[](#%5F%5Fcodelineno-6-7)
[](#%5F%5Fcodelineno-6-8)const set = async (count: number) => {
[](#%5F%5Fcodelineno-6-9)  await Badge.set({ count });
[](#%5F%5Fcodelineno-6-10)};
[](#%5F%5Fcodelineno-6-11)
[](#%5F%5Fcodelineno-6-12)const increase = async () => {
[](#%5F%5Fcodelineno-6-13)  await Badge.increase();
[](#%5F%5Fcodelineno-6-14)};
[](#%5F%5Fcodelineno-6-15)
[](#%5F%5Fcodelineno-6-16)const decrease = async () => {
[](#%5F%5Fcodelineno-6-17)  await Badge.decrease();
[](#%5F%5Fcodelineno-6-18)};
[](#%5F%5Fcodelineno-6-19)
[](#%5F%5Fcodelineno-6-20)const clear = async () => {
[](#%5F%5Fcodelineno-6-21)  await Badge.clear();
[](#%5F%5Fcodelineno-6-22)};
[](#%5F%5Fcodelineno-6-23)
[](#%5F%5Fcodelineno-6-24)const isSupported = async () => {
[](#%5F%5Fcodelineno-6-25)  const result = await Badge.isSupported();
[](#%5F%5Fcodelineno-6-26)  return result.isSupported;
[](#%5F%5Fcodelineno-6-27)};
[](#%5F%5Fcodelineno-6-28)
[](#%5F%5Fcodelineno-6-29)const checkPermissions = async () => {
[](#%5F%5Fcodelineno-6-30)  const result = await Badge.checkPermissions();
[](#%5F%5Fcodelineno-6-31)};
[](#%5F%5Fcodelineno-6-32)
[](#%5F%5Fcodelineno-6-33)const requestPermissions = async () => {
[](#%5F%5Fcodelineno-6-34)  const result = await Badge.requestPermissions();
[](#%5F%5Fcodelineno-6-35)};
`

## API[¶](#api "Permanent link")

* [get()](#get)
* [set(...)](#set)
* [increase()](#increase)
* [decrease()](#decrease)
* [clear()](#clear)
* [isSupported()](#issupported)
* [checkPermissions()](#checkpermissions)
* [requestPermissions()](#requestpermissions)
* [Interfaces](#interfaces)
* [Type Aliases](#type-aliases)

### get()[¶](#get "Permanent link")

`[](#%5F%5Fcodelineno-7-1)get() => Promise<GetBadgeResult>
`

Get the badge count. The badge count won't be lost after a reboot or app restart.

Default: `0`.

**Returns:** `Promise<[GetBadgeResult](#getbadgeresult)>`

---

### set(...)[¶](#set "Permanent link")

`[](#%5F%5Fcodelineno-8-1)set(options: SetBadgeOptions) => Promise<void>
`

Set the badge count.

| Param       | Type                                |
| ----------- | ----------------------------------- |
| **options** | [SetBadgeOptions](#setbadgeoptions) |

---

### increase()[¶](#increase "Permanent link")

`[](#%5F%5Fcodelineno-9-1)increase() => Promise<void>
`

Increase the badge count.

---

### decrease()[¶](#decrease "Permanent link")

`[](#%5F%5Fcodelineno-10-1)decrease() => Promise<void>
`

Decrease the badge count.

---

### clear()[¶](#clear "Permanent link")

`[](#%5F%5Fcodelineno-11-1)clear() => Promise<void>
`

Clear the badge count.

On **iOS**, this will remove the badge and also clear all notifications.

---

### isSupported()[¶](#issupported "Permanent link")

`[](#%5F%5Fcodelineno-12-1)isSupported() => Promise<IsSupportedResult>
`

Check if the badge count is supported.

**Returns:** `Promise<[IsSupportedResult](#issupportedresult)>`

---

### checkPermissions()[¶](#checkpermissions "Permanent link")

`[](#%5F%5Fcodelineno-13-1)checkPermissions() => Promise<PermissionStatus>
`

Check permission to display badge.

**Returns:** `Promise<[PermissionStatus](#permissionstatus)>`

---

### requestPermissions()[¶](#requestpermissions "Permanent link")

`[](#%5F%5Fcodelineno-14-1)requestPermissions() => Promise<PermissionStatus>
`

Request permission to display badge.

**Returns:** `Promise<[PermissionStatus](#permissionstatus)>`

---

### Interfaces[¶](#interfaces "Permanent link")

#### GetBadgeResult[¶](#getbadgeresult "Permanent link")

| Prop      | Type   |
| --------- | ------ |
| **count** | number |

#### SetBadgeOptions[¶](#setbadgeoptions "Permanent link")

| Prop      | Type   | Description                                                                                                        |
| --------- | ------ | ------------------------------------------------------------------------------------------------------------------ |
| **count** | number | The badge count to set. On **iOS**, setting the count to 0 will remove the badge and also clear all notifications. |

#### IsSupportedResult[¶](#issupportedresult "Permanent link")

| Prop            | Type    |
| --------------- | ------- |
| **isSupported** | boolean |

#### PermissionStatus[¶](#permissionstatus "Permanent link")

| Prop        | Type                                | Description                               |
| ----------- | ----------------------------------- | ----------------------------------------- |
| **display** | [PermissionState](#permissionstate) | Permission state of displaying the badge. |

### Type Aliases[¶](#type-aliases "Permanent link")

#### PermissionState[¶](#permissionstate "Permanent link")

`'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'`

## Quirks[¶](#quirks "Permanent link")

On **Android** not all launchers support badges. This plugin uses [ShortcutBadger](https://github.com/leolin310148/ShortcutBadger). All supported launchers are listed [there](https://github.com/leolin310148/ShortcutBadger#supported-launchers).

On **Web**, the app must run as an installed PWA (in the taskbar or dock).

## Changelog[¶](#changelog "Permanent link")

See [CHANGELOG.md](https://github.com/capawesome-team/capacitor-plugins/blob/main/packages/badge/CHANGELOG.md).

## License[¶](#license "Permanent link")

See [LICENSE](https://github.com/capawesome-team/capacitor-plugins/blob/main/packages/badge/LICENSE).

## Credits[¶](#credits "Permanent link")

This plugin is based on the [Capacitor Badge](https://github.com/capawesome-team/capacitor-badge) plugin. Thanks to everyone who contributed to the project!

May 17, 2026 

 Back to top 