4
votes

To change the unread count we need to call setNumber and use the NotificationManager to show the notification and update the badge count.

https://developer.android.com/reference/android/app/Notification.Builder.html#setNumber(int)

How do we update the count without showing the notification, I know its possible as whatsapp does it without showing the messages after some messages have been read from the app?

1

1 Answers

1
votes

You can set the importance of a notification to be lower. At IMPORTANCE_NONE, it won't show up in the notification shade.

Although if you do that, how would the user ever see the new unread count?