thudugala / thudugala/Plugin.LocalNotification
Badge on App Icon on iOS
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 474
- Forks
- 73
- PR merge metrics
- No merged PRs in 30d
Description
I cancelled and cleared all my requests, yet the badge number (1) on my iPad always shows up. Even after deleting the app and re-installing it. It is stuck. I no longer have any notifications yet the badge number shows up on my app icon.
The notification clears successfully from the Notification Center, but I still have the badge number on the App icon.
Weird thing is that when I add new requests, the badge number is updated, when I delete requests, once I get to zero, I still see 1.
Also...
Shouldn't the badge number property be part of Current instead of a Request? I mean, the badge is shown on a single app icon (we only see 1 icon displayed, so shouldn't the badge number always be the total number of notification requests? Feels like that property should not even have to be editable, it should just be a read only property that equals:
var current.BadgeNumber = await LocalNotificationCenter.Current.GetDeliveredNotificationList();
I am suspecting there is a bug in a loop of some sort that doesn't clear all the way down to zero.
Ex:
Every time I add a request, I set the BadgeNumber to be the count of await LocalNotificationCenter.Current.GetDeliveredNotificationList();
So add1-> BadgeNumber = 1
Add one more -> BadgeNumber = 2
Add one more -> BadgeNumber = 3
Now, cancel a notification -> BadgeNumber goes to to 2
Cancel another -> BadgeNumber goes to 1
Cancel the last one, -> Badge number is stuck on 1, even weider, sometimes goes back up to 2??
How can I clear the app icon badge once I have removed all my notifications?
Running on Visual Studio 2022 Preview on a Windows 11 machine
Targeted device is an iPad 10th Generation
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the add and cancellation flows that set Request.BadgeNumber and call LocalNotificationCenter.Current.GetDeliveredNotificationList(). Reproduce the sequence of adding three requests and cancelling them on the reported iPad target, then trace why the badge remains or increases after the delivered list reaches zero. Done means removing the final notification clears the app icon badge consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, ios
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100