Gathering detailed insights and metrics for cordova-plugin-badge
Gathering detailed insights and metrics for cordova-plugin-badge
Gathering detailed insights and metrics for cordova-plugin-badge
Gathering detailed insights and metrics for cordova-plugin-badge
@types/cordova-plugin-badge
TypeScript definitions for cordova-plugin-badge
cordova-plugin-badge-fix
Shows the count of unread messages as a badge on the app icon.
cordova-plugin-badge-construct
Shows the count of unread messages as a badge on the app icon.
cordova-plugin-android-badge-counter
Cordova Plugin For Android Badge Counter
npm install cordova-plugin-badge
Typescript
Module System
Node Version
NPM Version
JavaScript (35.39%)
Objective-C (28.37%)
Objective-C++ (19.49%)
Java (16.75%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
Apache-2.0 License
406 Stars
228 Commits
250 Forks
39 Watchers
2 Branches
4 Contributors
Updated on Mar 05, 2025
Latest Version
0.8.9
Package Id
cordova-plugin-badge@0.8.9
Unpacked Size
557.67 kB
Size
475.33 kB
File Count
29
NPM Version
9.5.1
Node Version
19.8.1
Published on
Apr 22, 2023
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
No dependencies detected.
SAMPLE APP :point_right:
Cordova plugin to access and modify the badge number of the app icon on various mobile platforms including iOS, Android and Windows.
Users see notifications in the following ways:
The plugin can be installed via Cordova-CLI and is publicly available on NPM.
Execute from the projects root folder:
$ cordova plugin add cordova-plugin-badge
Or install a specific version:
$ cordova plugin add cordova-plugin-badge@VERSION
Or install the latest head version:
$ cordova plugin add https://github.com/katzer/cordova-plugin-badge.git
Or install from local source:
$ cordova plugin add <path> --nofetch --nosave
The plugin creates the object cordova.plugins.notification.badge
and is accessible after deviceready has been fired.
1document.addEventListener('deviceready', function () { 2 // cordova.plugins.notification.badge is now available 3}, false);
Badge numbers cannot be negative. The maximum might be restricted by the OS. A callback is optional and will be invoked with the current badge number.
1cordova.plugins.notification.badge.set(10);
There's built-in support to increase the badge number:
1cordova.plugins.notification.badge.increase(1, function (badge) { 2 // badge is now 11 (10 + 1) 3});
To decrease the badge number:
1cordova.plugins.notification.badge.decrease(2, function (badge) { 2 // badge is now 9 (11 - 2) 3});
And to clear out the badge number:
1cordova.plugins.notification.badge.clear();
The default value is 0. The badge number wont get lost after reboot or app restart.
1cordova.plugins.notification.badge.get(function (badge) { 2 ... 3});
Note: Modifying the badge number outside of the plugin does result into wrong behaivor!
To clear the badge number automatically if the user taps the app icon:
1cordova.plugins.notification.badge.configure({ autoClear: true });
OSX supports additional indicators. Other than to badge
these are circular
and download
.
1cordova.plugins.notification.badge.configure({ indicator: 'circular' });
The plugin might ask for granting permissions to modify the badge number. That's done automatically but it's also possible to request them manually:
1cordova.plugins.notification.badge.requestPermission(function (granted) { 2 ... 3});
To check if they have been granted already:
1cordova.plugins.notification.badge.hasPermission(function (granted) { 2 ... 3});
On Android not all launchers support badges. In order to set badges the plugin uses ShortcutBadger. Check out their website to see which launchers are supported.
If you're using PhoneGap Build please make sure you specify gradle as your Android build tool in config.xml:
1<preference name="android-build-tool" value="gradle" />
To specify a custom version of ShortcutBadger follow this guide. The name of the property is appShortcutBadgerVersion
.
1# In <your-project>/platforms/android/gradle.properties 2appShortcutBadgerVersion=1.1.22
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)This software is released under the Apache 2.0 License.
Made with :yum: from Leipzig
© 2013 appPlant GmbH
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More