Share via

iOS: The push notification number is not disappearing on my app icon after I open my app again

Kim Strasser 2,366 Reputation points
2026-04-07T10:12:10.14+00:00

I have tried to send push notifications to my app. I always receive the push notifications on my iPad Air and a red circle with the number 1 is displayed on my app icon. But this number never disappears. I have tried to tap again on my app icon to open it and I have even tried to quit the app and then open it again but the number doesn´t disappear. Why does the number not disappear? Is it necessary to do something in my code to make the number disappear?

I have installed my app in debug mode on my iPad Air, then I closed Visual Studio and I have tried to send push notifications to my app.

I found this example image on the internet. My app has the same red circle with the number 1 after I received a push notification:

https://cdn.prod.website-files.com/626933b7a67a8b11729163f8/63174b8d1e298188ba7f6f0b_vhSP3695xkEmARLPbyKB_1t31VTEqz4Td-k0txOJymajJnbkXhOPcWD3eqGipBZMS6kYh416nn3ehQ2r82r2MDccji3dpeSjjyM2h-rMEOogmyiE6KUaRvDy7izlBqY49o4Shd1wgfgURIfh8-mfUw.png

Developer technologies | .NET | .NET MAUI

1 answer

Sort by: Most helpful
  1. Q&A Assist
    2026-04-07T10:12:25.3+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    On iOS, the badge number on the app icon is not cleared automatically when the app is opened. The app (or the server sending the push) must explicitly set or reset the badge count.

    For a .NET MAUI/iOS app this is done via the iOS APIs that control the application icon badge number:

    • UIApplication.ApplicationIconBadgeNumber
    • Or, when scheduling local notifications, UILocalNotification.ApplicationIconBadgeNumber

    To clear the badge when the app is opened, set the badge number to 0 in the iOS-specific startup code (for example in FinishedLaunching or when the app becomes active):

    using UIKit;
    
    public override bool FinishedLaunching(UIApplication app, NSDictionary options)
    {
        // ... existing setup code ...
    
        UIApplication.SharedApplication.ApplicationIconBadgeNumber = 0;
        return base.FinishedLaunching(app, options);
    }
    
    public override void OnActivated(UIApplication uiApplication)
    {
        base.OnActivated(uiApplication);
    
        // Clear badge whenever the app becomes active
        UIApplication.SharedApplication.ApplicationIconBadgeNumber = 0;
    }
    

    If using local notifications, ensure that any UILocalNotification created does not keep incrementing the badge unintentionally, or that the server-side push payload sets the correct badge value.

    Without this explicit reset, iOS will keep showing the last badge number that was set.


    References:

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.