0 Replies
      Latest reply on May 10, 2019 12:59 AM by hanwel
      hanwel Level 1 Level 1 (0 points)

        Hi,

         

        got a serious problem to set the badge of my app iDay (a birthday reminder) to zero.

        The following code will set the badges for the next 30 days, the code will executed every time the user finishes the app.

        The badge is changing every midnight fine, except for those days with a zero badge. In this case the badge is showing the old value until a new (non zero) value is fired or the user starts the app (the badge is also recalced when the user starts the app and that is working also for zero values).

        I know the workaround to schedule the badge value "-1" to remove the badge, that was working fine for several years, but since several months, this is not working anymore. And scheduling "0" is also not working.

        Any ideas?

         

        Best,

        Hanno

         

        for (short n = 0; n <30; n++) {
          short nBadge = [self.all getNumberofDatesForBadge:n];
          notification = [[UILocalNotification alloc] init];
                    notification.fireDate = [nextMidnight dateByAddingTimeInterval:n*24*60*60];
          notification.timeZone = [NSTimeZone systemTimeZone];
          notification.applicationIconBadgeNumber = nBadge;
        
          [app scheduleLocalNotification:notification];
        }