Change in notification count in app logo

Currently the count on app logo is not reflecting the way it should be. Sometimes the app logo count is 3 while there are no new notifications. Can we handle the app icon count in the following way:
For example:

  • When user opens the app and already have 20 new notification (alarmbel)
  • When user closed the app
  • App logo count is 0
  • When he receives 1 update about an issue
  • App logo count is 1
  • When he opens the start screen of the app and sees 21 new notification (alarmbel)
  • When close the app
  • App logo count is 0

Basically it should work the same way how the app logo count is handled with Whatsapp.
Can anyone help me with a solution for this iam using @capacitor/push-notifications for getting push notifications and for badge count @capawesome/capacitor-badge for badge count