I want to set the recurrence interval to the value that the user selects from a date set. I have a date picker in type countdown mode in my application. If the user selects 4 hours 15 minutes after selecting a date, I set firedate using the following code and signal rings.
[NSDate dateWithTimeIntervalSinceNow:[pickerTimer countDownDuration]]
But I want this notification to be repeated every 4 hours 15 minutes until the user cancels it. I did r & d searched a lot, but I can not understand. The code I've used so far:
localNotification = [[UILocalNotification alloc] init]; [localNotification setFireDate:[NSDate dateWithTimeIntervalSinceNow:[pickerTimer countDownDuration]]]; if(localNotification.fireDate){ [self _showAlert:@"Time is scheduled" withTitle:@"Daily Achiever"]; } localNotification.timeZone = [NSTimeZone systemTimeZone]; localNotification.alertBody=@ "alaram"; localNotification.soundName = UILocalNotificationDefaultSoundName; [localNotification setAlertAction:@"View"]; [localNotification setRepeatInterval:[pickerTimer countDownDuration]];
Please help me decide. Thank you very much in advance.
source share