chemerisuk / cordova-plugin-firebase-messaging

Cordova plugin for Firebase Cloud Messaging

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to set badge count ?

aravindforums1 opened this issue · comments

I am using cordova-plugin-firebase-messaging to get token successfully and send notification to specific device, in index.js file , under the deviceready function i set the badge count, when i onBackgroundMessage() function and onMessage() function, but count not display in mobile icon.

     cordova.plugins.firebase.messaging.setBadge(10);
  cordova.plugins.firebase.messaging.onMessage(function(payload) {
         cordova.plugins.firebase.messaging.setBadge(10);
    });

    cordova.plugins.firebase.messaging.onBackgroundMessage(function (payload) {
       cordova.plugins.firebase.messaging.setBadge(10);
    });

Any reply much appreciated.

@aravindforums1 for background notifications you should set badge via appropriate payload property on server side.