Search code examples
androidfirebasepush-notificationfirebase-cloud-messagingandroid-launcher

Notification Count Badge in Android App Icon


I am developing and android application, where I am sending notifications to the user using Firebase Cloud Messaging Service. In order to make user more aware of notifications, I want to show the count of the notifications on the launcher icon of the app. Is there any way how can I do it? I don't want to create a widget. I have tried the library ShortcutBadger Link for the Library

But the issue with this library is that it is not working when the app is in background or killed?

I have used the count update method in the BroadcastReceiver of my app

Can someone suggest how to use it or a better way of doing it?


Solution

  • Android O introduces notification badges:

    https://developer.android.com/preview/features/notification-badges.html

    They show the number of notifications with a long-press on the icon. It will be awhile before O has widespread adoption, though.