Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7175439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:17:42+00:00 2026-05-28T16:17:42+00:00

When app is in foreground, even if I set the applicationBadgeNumber to 0, when

  • 0

When app is in foreground, even if I set the applicationBadgeNumber to 0, when I quit the app, there’s still a “1” badge on my app, even whem I kill it, any ideas? When I open the notification when the app is in background, no problem at all!

- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification 
    {   
        NSLog(@"%i", notification.applicationIconBadgeNumber); // Return 1
        notification.applicationIconBadgeNumber = 0;
        NSLog(@"%i", notification.applicationIconBadgeNumber); // Return 0

        UIApplicationState state = [application applicationState];

        if (state == UIApplicationStateInactive)
        {
            // Application was in the background when notification
            // was delivered.
        }
        else
        {
            UIAlertView *alert = [[UIAlertView alloc]
                                  initWithTitle:@"An item is asking your attention" message:nil delegate:nil
                                  cancelButtonTitle:@"Cancel" otherButtonTitles:@"Show me", nil];
            [alert show];
        }
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T16:17:42+00:00Added an answer on May 28, 2026 at 4:17 pm

    Where are you setting the applicationBadgeNumber? I think you are setting the notification badge number.

    Try this:

     application.applicationIconBadgeNumber = 0;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I add this function to post a notification when the app enter foreground: -
Is there any way to handle network events on-the-fly in iOS 4.2.1 when app
My app is a background service running in the foreground. In low memory situations
My app is expanding, but the reqs dictate that there should be only one
My app was built with SDK 2.2.1 version even before 3.0 beta appear. User
My app will access a webservice to access data (even if the application is
I'm writing an app that has a foreground service, content provider, and a Activity
My App is typically run overnight as a baby monitor, either as foreground app,
An android app that I'm writing seems to consume a lot of battery even
I'm creating an app that has a foreground app (of course) and both a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.