Notification badge update

i have set a notification badge for internal messaging in my app between two users. The badge count is displaying on the initial stage. But once I clicked the icon of the app the count get cleared. I want to clear the app only after I read the message inside the application. My requirement is to show the badge count every time one got a message even if the user is not inside the application. Also need to decrease the count on reading each message. Currently I wrote the code to set the badge count in app->components.ts using api for updated value. I have no idea about how to update the badge count in background of app, means when user is not inside the app. Please help me its urgent.

Thanks and regards

are you looking for this?

this shows the push notifications setting in ios. I guess it will help you.

thanks for your reply.
I am looking for internal messaging process not for push messages

Looking for then?

Currently I am using the same for notfication badge. Its working fine but the once we click the icon the badge get disppeareed. Also its not updating when the user was not live in the app.

Standard technique is to subscribe to a Subject, and update the badge whenever the Subject emits a new user status.