Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App badge odd behaviour #359

Open
bockc opened this issue Dec 3, 2020 · 2 comments
Open

App badge odd behaviour #359

bockc opened this issue Dec 3, 2020 · 2 comments

Comments

@bockc
Copy link

bockc commented Dec 3, 2020

I noticed that there's 2 behaviours for push notifications on Android :

  • unread count (persisting badge, I'd really like that !)
  • notifications count (only counts notifications in system tray)

For instance, WhatsApp counts the number of conversations containing unread messages and sets the badge accordingly. Whether you start the app and/or dismiss all notifications, the badge stays here and only updates when you read one of those conversations or receive a new message in another one.
Slack on the other hand works by counting the number of notifications in the system tray.

Another strange thing I noticed is that you can set a badge number like 42, but it won't appear since this library seems to only allow the notifications count mode. However, if you receive any notification, 42 will be set as the app's badge (not 43...). Right now, you'd expect that any new notification would bump the badge from 42 to 43 and so on since it's counting the notifications in my system tray, right ? Unfortunately it doesn't, you'd have to manually set the badge every time if you already did it once for your Android app I guess.

When my app receives a push notification when in background or killed state, I update my app badge from Firebase's backgroundMessageHandler. Anyway, I noticed the badge stays displayed and doesn't change when I dismiss a notification, but if I dismiss all of my notifications, the badge disappears...

Also, it's worth noting that I'm using this library wrapped in react-native-push-notification.

Am I doing something wrong here ?
My ideal goal would be having the same behaviour than iOS, but unfortunately right now I'm only able to have something in between iOS and Android. I'd like either my badge to reflect the actual notifications count or a badge that persists even when there's no notification in the system tray, because right now I am only able to offer this weird and confusing experience to our users.

Thanks !

@magamal
Copy link

magamal commented Jun 28, 2021

Any updates about this issue ??

@theneekz
Copy link

This is an Android launcher specific problem. You can set the icon number manually like you do for iOS but the device's settings will take precedence, what ever they are. My Samsung S9 running Android 10 has this important message in Settings -> Notifications -> App Icon Badged (it looks like a toggle but it will link to a page with more options):

"Show badges on apps that have notifications. Clear the notifications to remove the badges"

Sadly this is a feature and not a bug with some Android devices. I do think this package can be used in tandem with the Android device's default behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants