यह पेज अभी हिन्दी में उपलब्ध नहीं है, इसलिए आप इसका अंग्रेज़ी संस्करण पढ़ रहे हैं।

The Badging API: show a count on your app icon

Unread counts on your app icon, like a native app.

क्षमताएँ और API शुरुआती 1 मिनट में पढ़ें समीक्षा: 27 नव॰ 2026

The Badging API puts a number, or a dot, on your installed app's icon: in the Windows taskbar, the macOS Dock, the ChromeOS shelf, and the iPhone and iPad Home Screen.

// From a page or the service worker
if ('setAppBadge' in navigator) {
  navigator.setAppBadge(3);      // show 3
  navigator.setAppBadge();       // show a dot (no number)
  navigator.clearAppBadge();     // remove it
}

Where it works

  • Chrome and Edge on Windows, macOS and ChromeOS, for installed apps.
  • Safari on iOS and iPadOS 16.4+ for Home Screen web apps, and on macOS for web apps in the Dock. On Apple platforms the app needs notification permission for badges to show.
  • Not on Android: Android shows notification dots from your notifications instead.

From a push message

The most useful pattern is updating the badge when a push arrives, so it is right even when the app is closed:

self.addEventListener('push', (event) => {
  const data = event.data.json();
  event.waitUntil(Promise.all([
    self.registration.showNotification(data.title, { body: data.body }),
    navigator.setAppBadge?.(data.unread),
  ]));
});

Clear it when the user opens the relevant screen. Keep the number meaningful: unread messages or tasks that need action, not marketing.

ब्राउज़र सपोर्ट

PWA फ़ीचर के लिए ब्राउज़र सपोर्ट
फ़ीचरChrome / Edge desktopChrome AndroidSafari iOS / iPadOSSafari macOSFirefox desktopFirefox AndroidSamsung Internet
App badge (Badging API) Chrome / Edge desktop: हाँ (Installed apps) Chrome Android: नहीं Safari iOS / iPadOS: आंशिक (Home Screen apps with notification permission) Safari macOS: आंशिक (Web apps in the Dock) Firefox desktop: नहीं Firefox Android: नहीं Samsung Internet: नहीं

पूरी सपोर्ट तालिका देखें