I have initialize local notification for every 30 seconds. and i want to stop repeating it once user has pressed button for stop Local Notification.
problem is i couldnt find a way of doing it. it keeps repeating every 30 seconds
This is how i have sheducled localnotification
// Schedule the notification
UILocalNotification* localNotification = [[UILocalNotification alloc] init];
localNotification.fireDate = [NSDate dateWithTimeIntervalSinceNow:30];
localNotification.alertBody = @"Testing Repeating Local Notification";
localNotification.applicationIconBadgeNumber = 1;
localNotification.timeZone = [NSTimeZone defaultTimeZone];
localNotification.soundName = UILocalNotificationDefaultSoundName;
localNotification.repeatCalendar = [NSCalendar currentCalendar];
localNotification.repeatInterval = kCFCalendarUnitSecond;
[[UIApplication sharedApplication] scheduleLocalNotification:localNotification];
I have tried [[UIApplication sharedApplication] cancelAllLocalNotifications];
. but it dosent work.