Badge

Improve this doc

$ ionic plugin add cordova-plugin-badge

Repo: https://github.com/katzer/cordova-plugin-badge

The essential purpose of badge numbers is to enable an application to inform its users that it has something for them — for example, unread messages — when the application isn’t running in the foreground.

Requires Cordova plugin: cordova-plugin-badge. For more info, please see the Badge plugin docs.

Supported platforms

Usage

import {Badge} from 'ionic-native';


Badge.set(10);
Badge.increase();
Badge.clear();

Static Methods

clear()

Clear the badge of the app icon.

set(number)

Set the badge of the app icon.

Param Type Details
number number

The new badge number.

Returns: Promise

get()

Get the badge of the app icon.

Returns: Promise

increase(count)

Increase the badge number.

Param Type Details
count number

Count to add to the current badge number

Returns: Promise

decrease(count)

Decrease the badge number.

Param Type Details
count number

Count to subtract from the current badge number

Returns: Promise

hasPermission()

Determine if the app has permission to show badges.

registerPermission()

Register permission to set badge notifications

Returns: Promise

API

Native

General