Navigator.clearAppBadge()

The clearAppBadge() method of the Navigator interface clears a badge on the current app's icon by setting it to nothing. The value nothing indictes that no badge is currently set, and the status of the badge is cleared.

Syntax

let promise = Navigator.clearAppBadge();

Parameters

None.

Return value

A Promise that resolves with undefined.

Exceptions

NotSupportedError
The Navigator does not have a document that this action can be acted on.

Examples

Once all messages in an application have been read, call clearAppBadge() to clear the badge and remove the notification.

navigator.clearAppBadge()

Specifications

Specification Status Comment
Badging API
The definition of 'clearAppBadge' in that specification.
Draft Initial definition.

Browser compatibility

BCD tables only load in the browser

See also