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

  • SEARCH
  • Home
  • 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 9212821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:36:45+00:00 2026-06-18T01:36:45+00:00

[[UIApplication sharedApplication] cancelAllLocalNotifications]; [[UIApplication sharedApplication] setApplicationIconBadgeNumber: 0];’ I added the above code to didfinishLaunchingWithOptions

  • 0
[[UIApplication sharedApplication] cancelAllLocalNotifications];
[[UIApplication sharedApplication] setApplicationIconBadgeNumber: 0];'

I added the above code to didfinishLaunchingWithOptions but when a user taps a notification in his notification center and enters my app the notification does not gets cleared.

Edit:

I also tried adding this to my code:

You Also need to increment then decrement the badge in your
application:didReceiveRemoteNotification: method if you are trying
to clear the message from the message centre so that when a user
enters you app from pressing a notification the message centre will
also clear, ie:

[[UIApplication sharedApplication] setApplicationIconBadgeNumber: 1];
[[UIApplication sharedApplication] setApplicationIconBadgeNumber: 0];
[[UIApplication sharedApplication] cancelAllLocalNotifications];  

as describes here: iOS application: how to clear notifications? but the notification still won’t clear from the notification center

  • 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-06-18T01:36:46+00:00Added an answer on June 18, 2026 at 1:36 am

    I just Added a Badge number manually to my application and pasted

    - (void)applicationDidBecomeActive:(UIApplication *)application
    {
          application.applicationIconBadgeNumber = 0;
    }
    

    To my AppDelegate. For me this works like a charm.
    Note that didfinishLaunchingWithOptions and applicationDidBecomeActive are not the same as Mouhammad Lamaa explained. If you paste this to your AppDelegate and tap the notification in notification center it should disapper. If it does not your App maybe creates a new Notification after becoming active?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

NSLog(@push notification in process); [[UIApplication sharedApplication]registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge|UIRemoteNotificationTypeSound|UIRemoteNotificationTypeAlert)]; Entering above code in appdelegate.m file in didFinishLaunchingWithOptions:
I am trying to use this code: ((AppDelegate)UIApplication.SharedApplication.Delegate).MainTabBarController.Reset(); but I want to know if
(WebService_1AppDelegate*)[[UIApplication sharedApplication] delegate] here - in above statement WebService_1AppDelegate is my application name. But
NSURL *url = [NSURL URLWithString:@facetime://+123456789]; [[UIApplication sharedApplication] openURL:url]; In the above code 123456789 is
I used some code like below: [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@sms://123]]; what would happen if
I have the following code NSURL *url = [NSURL URLWithString:@workingUrl]; [[UIApplication sharedApplication] openURL:url]; which
As the title says, here's some code: - (void)refreshMap { NSLog(@refreshing); [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES];
Is it possible to set [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES]; in - application:didFinishLaunchingWithOptions: It doesn't seem
I found that [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@prefs:root=NOTIFICATIONS_ID]]; goes to notification settings. Can I go
enter code here-(IBAction)Call:(id)sender{ //[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@tel://18005551234]]; /*NSString *phoneStr = [[NSString alloc] initWithFormat:@tel:%@,phoneNumber.text]; NSURL

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.