//Get Time from the UIDatePicker
NSDate *selected = [[datePickerObj date] copy];
UILocalNotification *localNotification=[[UILocalNotification alloc]init];
localNotification.fireDate=[format dateFromString:[selected descriptionWithLocale:[[NSUserDefaults standardUserDefaults] dictionaryRepresentation]]];
[localNotification setFireDate:selected];
localNotification.alertBody=[NSString stringWithFormat:@"Time For The Prayer"];
/*
Options available for the repeat notification
NSEraCalendarUnit
NSYearCalendarUnit
NSMonthCalendarUnit
NSDayCalendarUnit
NSHourCalendarUnit
NSMinuteCalendarUnit
NSSecondCalendarUnit
NSWeekCalendarUnit
NSWeekdayCalendarUnit
NSWeekdayOrdinalCalendarUnit
NSQuarterCalendarUnit
*/
localNotification.repeatInterval = NSDayCalendarUnit; //For Daily alarm
localNotification.soundName=UILocalNotificationDefaultSoundName;
UIApplication *app=[UIApplication sharedApplication];
[app scheduleLocalNotification:localNotification];
NSDate *selected = [[datePickerObj date] copy];
UILocalNotification *localNotification=[[UILocalNotification alloc]init];
localNotification.fireDate=[format dateFromString:[selected descriptionWithLocale:[[NSUserDefaults standardUserDefaults] dictionaryRepresentation]]];
[localNotification setFireDate:selected];
localNotification.alertBody=[NSString stringWithFormat:@"Time For The Prayer"];
/*
Options available for the repeat notification
NSEraCalendarUnit
NSYearCalendarUnit
NSMonthCalendarUnit
NSDayCalendarUnit
NSHourCalendarUnit
NSMinuteCalendarUnit
NSSecondCalendarUnit
NSWeekCalendarUnit
NSWeekdayCalendarUnit
NSWeekdayOrdinalCalendarUnit
NSQuarterCalendarUnit
*/
localNotification.repeatInterval = NSDayCalendarUnit; //For Daily alarm
localNotification.soundName=UILocalNotificationDefaultSoundName;
UIApplication *app=[UIApplication sharedApplication];
[app scheduleLocalNotification:localNotification];
Comments
Post a Comment