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