1

Any possibility to reset/clear app badge without any app interactions such as opening the app or any push/local notifications. My need is, I want to reset my app badge starting off every day without even opening the app or with any notifications.

anas.p
  • 2,246
  • 19
  • 26

2 Answers2

0

You can schedule local notification for end of day with badge count equal 0. Check this out Updating iOS badge without push notifications

Ivan Vavilov
  • 1,520
  • 1
  • 15
  • 28
0

I solved this problem with the help of this solution. The working code is:

UILocalNotification* localNotification = [[UILocalNotification alloc] init];
NSCalendarUnit unitDay = NSCalendarUnitDay;
localNotification.repeatInterval = unitDay;
localNotification.fireDate = fireDate;
localNotification.applicationIconBadgeNumber = -1;
[[UIApplication sharedApplication] scheduleLocalNotification:localNotification];

Local notification has no alertBody, so local notification will not display upfront. If need to show alertBody then add localNotification.alertBody = @"Your notification alertBody";.

Thanks for the answer.

anas.p
  • 2,246
  • 19
  • 26