Badge

Contents

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.

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

联系我们?

If you're building a serious project, you can't afford to spend hours troubleshooting. Ionic's experts offer official maintenance, support, and integration help.

Contact Us Today!

Ionic 徽章Badge插件的安装(Installation)

ionic cordova plugin add cordova-plugin-badge npm install @ionic-native/badge
Ionic EE comes with fully supported and maintained plugins from the Ionic Team. Learn More or Contact Us
ionic enterprise register --key=YOURPRODUCTKEY npm install @ionic-enterprise/badge

Ionic 徽章Badge插件支持的平台(Supported Platforms)

  • Android
  • Browser
  • iOS
  • Windows

Ionic 徽章Badge插件的用法(Usage)

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

constructor(private badge: Badge) { }

...

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