0

I am trying for few days to do an alarm App which will sent a Localnotification everyDay at 8AM. my code is below working nicely in foreground, background and Suspended states.

NSDate *alertTime = [[NSDate date]
                     dateByAddingTimeInterval:5];
UIApplication* app = [UIApplication sharedApplication];
self.notifyAlarm = [[UILocalNotification alloc]
                                    init];
//   if (notifyAlarm){
self.notifyAlarm.fireDate = alertTime;
self.notifyAlarm.timeZone = [NSTimeZone defaultTimeZone];
self.notifyAlarm.repeatInterval = NSMinuteCalendarUnit;
//    notifyAlarm.soundName = @"bell_tree.mp3";
self.notifyAlarm.alertBody = @"Staff meeting in 30 minutes";
self.notifyAlarm.applicationIconBadgeNumber=[UIApplication sharedApplication].applicationIconBadgeNumber+1;
[app scheduleLocalNotification:self.notifyAlarm];
//   }

But I need to Increase the Badge number when I didnt seen previous local Notification that has been fired. and Decrease Automatically When I see that Notification Dynamically.

Please anyone Help me

Nivas
  • 18,126
  • 4
  • 62
  • 76
Hak
  • 145
  • 1
  • 9

1 Answers1

0

It is not possible in local push notification: Please refer the following link: DUPLICATE ASKED QUESTION AS OF YOU.

How to increment application badge number for recurring local notification (iPhone)

Community
  • 1
  • 1
Shankar Aware
  • 128
  • 1
  • 11