Setting badge number to 0 removes all notifications

On iOS, when a user taps on a notification from the Notifications screen, the app is foregrounded and I decrement the current badge number:

Notifications.getBadgeNumberAsync().then(badgeNumber => {
  if (badgeNumber !== 0) {
    Notifications.setBadgeNumberAsync(badgeNumber - 1);
  }
});

If the number of notifications doesn’t match the badge number (due to older notifications for instance) and I set the badge number to 0, all notifications are removed from the Notifications screen. Is this intentional and is there away around it that does not involve synchronizing the amount of notifications with the badge number?

1 Like

This is how iOS behaves. You might be able to set the badge number to -1 but this seems like undocumented behavior. Clear badge count without removing… | Apple Developer Forums

1 Like