App icon badge

Use day::set_app_badge(&AppBadge) to set or clear the app icon badge. This is separate from a navigation item’s badge. The function delegates to the running toolkit and returns ().

API boundary

AppBadge has None, Count(u32), Text(String), and Dot variants. Probe Cap::AppBadgeCount, Cap::AppBadgeText, or Cap::AppBadgeDot through capability before choosing a payload. Unsupported payloads are ignored rather than converted to another kind. Localize app-owned text before constructing AppBadge::Text.

Platform behavior

TargetCountTextDotBehavior
macOS / AppKitYesYesYesDock tile label; cleared when the process exits
iOS / UIKitYesNoNoRequires notification permission; the count survives app termination
Windows / WinUI or XAMLYesNoYesTaskbar overlay; counts above 99 display as 99+
Linux / GTK or QtEmulatedNoNoUnity launcher D-Bus signal; the desktop shell decides whether to display it
AndroidNoNoNoUse a local notification’s badge instead
HarmonyOS / ArkUIYesNoNoNotification Kit badge number
Browser / DOMEmulatedNoEmulatedBrowser Badging API; requires browser and installed-app support

Only AppKit accepts arbitrary text. Other targets ignore AppBadge::Text; choose a count or omit the badge when Cap::AppBadgeText is unsupported.

On iOS, request notification permission before setting a count. Clear the badge when its information is no longer relevant. A WillTerminate handler can clear it during an orderly exit, but iOS can terminate a suspended app without that callback; update it on the next launch as well. See lifecycle events.

Android derives launcher badges from notifications. Use Notification::badge(n) from local notifications; the launcher determines whether a count or dot appears.

GTK and Qt on Linux emit the same Unity launcher signal. Stock GNOME Shell ignores it; shells or extensions that implement the protocol can display it. This is why the capability reports Emulated rather than promising a visible badge.

See app progress for progress indicators. The design record retains the earlier badge proposal and implementation history.