Search docs/

Badge

v0.8.8

The Badge plugin enables 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.

Index

Classes


Classes

Badge

Badge:

usage:

import { Badge } from '@ionic-enterprise/badge/ngx';

constructor(private badge: Badge) { }

...

this.badge.set(10);
this.badge.increase(1);
this.badge.clear();

clear

clear(): Promise<boolean>

Clear the badge of the app icon.

Returns: Promise<boolean>


decrease

decrease(decreaseBy: number): Promise<any>

Decrease the badge number.

Parameters:

Name Type Description
decreaseBy number Count to subtract from the current badge number

Returns: Promise<any>


get

get(): Promise<any>

Get the badge of the app icon.

Returns: Promise<any>


hasPermission

hasPermission(): Promise<any>

Determine if the app has permission to show badges.

Returns: Promise<any>


increase

increase(increaseBy: number): Promise<any>

Increase the badge number.

Parameters:

Name Type Description
increaseBy number Count to add to the current badge number

Returns: Promise<any>


isSupported

isSupported(): Promise<any>

Check support to show badges.

Returns: Promise<any>


requestPermission

requestPermission(): Promise<any>

Register permission to set badge notifications

Returns: Promise<any>


set

set(badgeNumber: number): Promise<any>

Set the badge of the app icon.

Parameters:

Name Type Description
badgeNumber number The new badge number.

Returns: Promise<any>



Other Versions