Handling notifications badge number on Android

#1

How can we handle and show a launch screen icon badge that shows the notifications count on Android. I know it currently depends on third party plugins and launchers, but I’ve seen many applications already supporting that feature on Android and I’m wondering if anybody got it to work on Expo ? Is it going to be in a future update, seeing as Google started supporting these in the newest Android Oreo update ?

#2

Hi! I’m not sure what our exact timeline for Android Oreo features will be, but this shouldn’t be too hard to build. Can you make a feature request for this?

cc @jesse

#3

Has there been any progress with this? All the Expo docs seem to suggest there is still currently no support for the Android badge.

#4

Hi @topmillerm2! We haven’t worked on this. If you’re interested I’d recommend submitting a feature request here: https://expo.canny.io/feature-requests or working on a PR. For now you could also detach and build it yourself.

#5

Heads-up that Expo does support some of the new Android icon badge behavior (as described here) by virtue that all apps support the default behavior. By default, if there are notifications in the tray, an app will show a badge. The long press on the icon should show the number of notifications for the app currently in the tray. An app can then affect the count and whether the badge shows at all by dismissing notifications via the notification API.

What Expo doesn’t support is selectively not counting certain notifications towards the badge/ count, changing the count explicitly without dismissing notifications, setting a small or large badge, and probably some other minutiae that you have to specifically opt into.

#6

This works for android O but what about prior versions? the badge does not show.

#7

There’s no badge on prior Android versions. At least for stock Android. There might have been badges implemented by OEM’s with custom launchers like Samsung, but I haven’t seen or heard of Expo supporting those and not really sure even to what extent they can be taken advantage of by third party devs.

1 Like
#8

What Expo doesn’t support is selectively not counting certain notifications towards the badge/ count

For the good of the order, just wanted to note that this particular option is now possible with notification channels.