question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Notifications.setBadgeCountAsync(0); Does not work on Android

See original GitHub issue

Summary

Notifications.setBadgeCountAsync(0); Does not work on Android.

Also when the badge number is sent with the expo notification to the android device, the badge number gets added to the current badge number instead of overriding the badge number like the ios functionality.

Managed or bare workflow? If you have ios/ or android/ directories in your project, the answer is bare!

managed

What platform(s) does this occur on?

Android

SDK Version (managed workflow only)

41

Environment

Expo CLI 4.4.3 environment info: System: OS: macOS 10.15.7 Shell: 3.2.57 - /bin/bash Binaries: Node: 10.16.3 - /usr/local/bin/node npm: 6.14.5 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman SDKs: iOS SDK: Platforms: iOS 13.5, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2 Android SDK: API Levels: 25, 26 Build Tools: 23.0.1, 23.0.3, 25.0.0, 25.0.2, 25.0.3, 26.0.1, 26.0.2, 27.0.1, 27.0.3 System Images: android-25 | Google Play Intel x86 Atom, android-30 | Google APIs Intel x86 Atom IDEs: Android Studio: 3.0 AI-171.4443003 Xcode: 11.5/11E608c - /usr/bin/xcodebuild npmPackages: expo: ^41.0.0 => 41.0.1 react: 16.13.1 => 16.13.1 react-dom: 16.13.1 => 16.13.1 react-native: https://github.com/expo/react-native/archive/sdk-41.0.0.tar.gz => 0.63.2 react-native-web: ~0.13.12 => 0.13.18 react-navigation: ^4.4.0 => 4.4.4 npmGlobalPackages: expo-cli: 4.4.3 Expo Workflow: managed

Reproducible demo or steps to reproduce from a blank project

Use Notifications.setBadgeCountAsync(0); in the Android app.

Also, try sending a badge # in the Expo notification. The badge number is added rather than overrwritten.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:17 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
brentvatnecommented, Sep 12, 2022

@mikeRChambers610 - it was closed automatically because there was no activity for several months and nobody responded when prompted about it being closed. can you open a new issue with a minimal reproducible example? we’re a small team and trying to stay up on top of everything and the best ways to get help are:

  • create a good issue with reproducible example repo we can clone and run and reproduce
  • investigate the root cause and share your findings
  • send a pr with a proposed fix
1reaction
hadrijaucommented, May 18, 2022

I am having the same problem. Did someone manage to solve it ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Changing badge count in Push Notifications with Expo in ...
Setting an arbitrary badge count on iOS can be done with Notifications. ... Android the only option available is to make the sent...
Read more >
Notifications - Expo Documentation
On Android 13, app users must opt-in to receive notifications via a permissions prompt automatically triggered by the operating system. This prompt will...
Read more >
Basics and caveats of Expo-notifications - DEV Community ‍ ‍
Be aware that expo-notifications does not work on emulators, so you should tested on real devices. You can use Expo Go to test...
Read more >
expo-notifications - npm
A 0 value means that the badge is not displayed. Note: Not all Android launchers support application badges. If the launcher does not...
Read more >
React Native: Working with Notification Badges | by Ross Bulat
When used wisely badges can be very effective to not only alert a user ... the badge can simply be done by setting...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found