Search docs/
Getting StartedPlugins

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.

Android Note: Badges have historically only been a feature implemented by third party launchers and not visible unless one of those launchers was being used (E.G. Samsung or Nova Launcher) and if enabled by the user. As of Android 8 (Oreo), notification badges were introduced officially to reflect unread notifications. This plugin is unlikely to work as expected on devices running Android 8 or newer. Please see the local notifications plugin docs for more information on badge use with notifications.

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

Premier Version Available

Featuring regular release cycles, security and bug fixes, and guaranteed SLAs.

Available here

インストール

ionic cordova plugin add cordova-plugin-badgenpm install @ionic-native/badgenpm install cordova-plugin-badgenpm install @ionic-native/badgeionic cap sync
Ionic Native Enterprise はIonic Teamが完全にサポートしメンテナンスしているプラグインを利用できます。 詳しくみる か、エンタープライズプラグインに興味があれば 連絡ください

サポートしているプラットフォーム

  • Android
  • Browser
  • iOS
  • Windows

利用方法

React

See here.

Angular

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

constructor(private badge: Badge) { }

...

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