1

I am writing Android cordova application.I want to display notification count in app icon same as below image. I am using local Notification plugin for notification but how can I display badge number in app icon. I tried badge plugin of cordova. https://github.com/katzer/cordova-plugin-badge but it's not working in android.

enter image description here

Thanks in Advance.

Krishna
  • 893
  • 1
  • 10
  • 24

2 Answers2

1

This may help you to set badge

cordova.plugins.notification.badge.set(1);

also check $cordovaBadge

module.controller('MyCtrl', function($cordovaBadge) {

  $cordovaBadge.set(3).then(function() {
    // You have permission, badge set.
  }, function(err) {
    // You do not have permission.
  });

});

For more see this

Aditya Vyas-Lakhan
  • 13,409
  • 16
  • 61
  • 96
1

Stock Android does not offer this functionality at the moment on the standard launcher.

Certain manufacturers (e.g. Samsung notably) have included this functionality into their customised Android launchers. Also some 3rd-party launchers (e.g. Nova Launcher) have included an API to accomplish this.

You may want to check following links for further explaination:

  1. How does Facebook add badge numbers on app icon in Android?
  2. Does Samsung modifies it's Android ROMs to have badges on email and SMS icons?
  3. How to make application badge on android?

Regards

Community
  • 1
  • 1
Hardik Vaghani
  • 2,163
  • 24
  • 46