Cordova-plugin-firebase update badge when app in background


i want to update the badge number if a message is receive. but in in plugin cordova-plugin-firebase it is only possible, if the app is in foreground. how can i do that if the app is in background or closed?

i try the plugin cordova-plugin-fcm-with-dependecy-updated, but is not firing.

initializeApp() {
    this.platform.ready().then(() => {
      this.firebaseCloudMsg.onNotification().subscribe(data => {
        console.log('DATA: ', data);
          console.log("Received in background", data);
        } else {
          console.log("Received in foreground", data);


any solution for this problem?

ok, i found a solution. i try to send the badge number direkt over the firebase console i an optional field. this is not working. but we use our own server to send push notifications from our system to

what we need to send JSON in the correct format and then it works.

1 Like