Notification badge stuck on app icon
I have a very strange issue with an app on my iPhone 14 Pro (IOS 17.5.1).
The app is allowed all kinds of notifications and usually works correctly like any other app; however, some times ago (I think a couple of weeks), I received a notification and after reading and deleting it the red badge with "1" on the app icon got stuck; the app icon always appears as having one pending notification, however there are no notifications anywhere, even inside the app itself (which has its own internal list of notifications).
What I tried:
- Force closing the app; nothing changes.
- Rebooting the iPhone; nothing changes.
- Disabling badge notifications (or notifications altogether) for the app; the badge disappears, but when I re-enable notifications it reappears.
- Last but not least (and this is what I find most strage), uninstalling the app. But then, when I reinstalled it, for some unknowable reason its icon appeared again with the red "1" badge.
I would consider this to be a bug in the app, but how can it survive after uninstalling and reinstalling the whole app?
I can confirm all application data is deleted when I remove the app, because after reinstalling it I have to go again through its first-run setup (during which the app asks for consent to show notifications and you have to explicitly grant it); however, it looks like the phantom pending notification remains stored somewhere on the iPhone, because immediately after reinstalling the app it is already present on its icon.
Also, during this time period I received other notifications from the app; but the number on the red badge always remains "1".
Any idea about how to fix this?
iPhone 14 Pro, iOS 17