Badge

v0.8.8

Contents

Installation

In order to use Ionic Enterprise Edition plugins you should make sure you're using the Ionic Enterprise Cordova CLI as the regular version can have issues with scoped plugins.

npm uninstall -g cordovanpm install -g @ionic-enterprise/cordova

Once you've installed the Ionic Enterprise Cordova CLI you can install the plugin.

ionic enterprise register --key=YOURPRODUCTKEYionic cordova plugin add @ionic-enterprise/badge

Index

Classes


Classes

Badge

Badge:

name: Badge

description: 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.

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