0

I scheduled the Local notification for current day +1 and time say 10AM.When I change the device date to current day+1 and time 10PM then notification didn't show up.

Code is given below:

UILocalNotification * localNot = [[UILocalNotification alloc] init];
localNot.userInfo = [NSDictionary dictionaryWithObjectsAndKeys:
                     @"ReminderId", @"REM01", nil];
localNot.alertBody = @"Alarm";

NSString *str =@"10/15/2014 9:15 AM";
NSDateFormatter *formatter = [[NSDateFormatter alloc]init];
formatter.timeZone = [NSTimeZone defaultTimeZone];
[formatter setDateFormat:@"MM/dd/yyyy hh:mm a"];
NSDate *date = [formatter dateFromString:str];
localNot.timeZone = [NSTimeZone defaultTimeZone];
localNot.fireDate = date;
localNot.repeatInterval = 0;
[[UIApplication sharedApplication] scheduleLocalNotification:localNot];

Need input.Thanks in advance.

Akshay Shah
  • 1,120
  • 6
  • 13

0 Answers0