0

The problem is IconBadgeNumber "1" still appear.

I have removed all applicationIconBadgeNumber description,
removed the app and built again.
nonetheless Icon Badge Number still appear.

Why do such problem occur?

kusumoto_teruya
  • 2,415
  • 4
  • 23
  • 38

2 Answers2

0

This question seems to be a duplicate, be sure to check out Removing badge from iOS app icon

Next time, try to do some research before asking please.

Community
  • 1
  • 1
kiwixz
  • 1,380
  • 15
  • 23
0

You can remove the badge number by assigning the applicationIconBadgeNumber property of the notification to 0.

Taken from the Apple Developer Docs:

(When your app is in the background)

    - (void)application:(UIApplication *)app didReceiveLocalNotification:(UILocalNotification *)notif {
    NSString *itemName = [notif.userInfo objectForKey:ToDoItemKey];
    [viewController displayItem:itemName];  // custom method
    app.applicationIconBadgeNumber = notification.applicationIconBadgeNumber - 1;
}

and when your app is being launched:

- (void)application:(UIApplication *)app didFinishLaunchingWithOptions:(NSDictionary *)opts {
    // check launchOptions for notification payload and custom data, set UI context
    [self startDownloadingDataFromProvider];  // custom method
    app.applicationIconBadgeNumber = 0;
    // other setup tasks here....
}
joels
  • 1,292
  • 15
  • 21