Android notification badge on launcher icon - android

I want to show unread messages count on my android app's launcher icon. It should be cleared only, once the user read all messages. I have tried setnumber method inside my firebase push notification service class. But it is not showing badge count. Then I used this library, https://github.com/leolin310148/ShortcutBadger . Now it is showing badge count. But the problem is,when user open the app or remove notifications this badge count will automatically disappear. How can I show badge count on launcher icon?

Related

Update badge count on app icon without push notification

I am working on android application on which I need to show count on app icon when ever I receive value from api. I am able to update badge value on app icon through notification, but I am unable to update badge count on app icon without notification.
so my question is, do we always need a notification to update count on app icon?
I checked what's app and found that the count on app icon increased through notification but they have clearly mention on their site that Badge count is a notification functionality provided by your launcher and is not a function of WhatsApp. If you continue to experience issues, please contact your phone's manufacturer.
so again my question is how the count is getting decreased after reading the message, suppose the count is 59 and after reading one message count goes to 58?
Yes. We can do it.
By default, you can create a onGoing Notification builder and notify with priority is LOW, and at the same time, you display by ShortcutBadger.
Make sure the notification is silent mode.

Is there a way to control app icon shortcut badge count in a react-native android application?

Actually the thing I want to achieve is, normally the shortcut icon badge count in android got cleared once the push notification popup is acknowledged by an user from notification panel, but instead clearing the count as above it has to be cleared only after the corresponding notification is acknowledged by an user within the app(for eg: if an user received a text message then the badge count will increased to one and once the user cleared the push notification popup form notification panel then the badge will also got cleared, but instead of that badge should be cleared only after the user viewed the message).
I tried the following packages.
https://www.npmjs.com/package/react-native-app-badge
https://www.npmjs.com/package/react-native-android-badge
Looks like you can use ShortcutBadge.setCount(0); to clear the badge counter!
I dont know what you use to display a notification on the android device itself, probably react-native-push-notification.
If that's the case, they also have a function for it:
PushNotification.setApplicationIconBadgeNumber(0)
You just need to run one of these functions when the event of a dismissed notification triggers, which may or may not need some java coding for achieve it!

Xiaomi: what code to request permission to show app badge icon

My app gets notification, but, to show notification badgen it needs the "show app badge icon" in parameter > app > notification > show app badge icon.
What's the code for my app to ask this permission ? (prompting something that would send the user to this screen, and he can allow notification badges)
notificationChannel.setShowBadge(true)
Notification badges are shown by default, for changing this setting programmatically we must uninstall the program first and reinstall it.

Show ONLY notification dot on app icon WITHOUT notificatioN

Does there exists any mechanism in Android where ONLY notification dot gets displayed without any notification item ?
I just want to show notification dot on app icon to notify user about updates within the app.
Is this possible ?

Add Notification Badge for unread Notifications in Android

I want to add the count of unread notification at my app icon
I tried this link but this was not helpful
Take a look this might work and can make your Android App showing the count of unread messages as a badge on your App shortcut
shorcutBadger

Categories

Resources