A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
Hi @Kim Strasser ,
Thank you for your inquiry.
You do not clear the badge when the app becomes active again, so the badge will always show until you clear it. I suggest clearing the badge in the OnActivated method of your main activity (in Program.cs):
public override void OnActivated(UIApplication application)
{
base.OnActivated(application);
// Modern way - recommended by Apple (iOS 16+)
if (UIDevice.CurrentDevice.CheckSystemVersion(16, 0))
{
UNUserNotificationCenter.Current.SetBadgeCount(0, (error) =>
{
if (error != null)
{
System.Diagnostics.Debug.WriteLine("Failed to clear badge: " + error.LocalizedDescription);
}
});
}
else
{
// Old way for older iOS
UIApplication.SharedApplication.ApplicationIconBadgeNumber = 0;
}
UNUserNotificationCenter.Current.RemoveAllDeliveredNotifications();
}
After adding the code, please clean and rebuild your project. Then, uninstall the app -> reinstall and test again.
I hope this addresses your question. If this response was helpful, please consider following the guidance to provide feedback.