uilocalnotification* localnotification = [[uilocalnotification alloc]init];
localnotification. alertbody = @ "This is a local notification";
Localnotification. soundname = uilocalnotificationdefaultsoundname;
Schedule the time to push local notification
Nscalendar* calendar = [nscalendar Autoupdatingcurrentcalendar];
nsdate* currentdate = [nsdate date];
nsdatecomponents* currentdatecomponents = [Calendar components:nsyearcalendarunit| Nsmonthcalendarunit| Nsdaycalendarunit| Nshourcalendarunit| Nsminutecalendarunit| Nssecondcalendarunit fromdate: currentdate];
nsdatecomponents* scheduleddatecomponents = currentdatecomponents;
if (currentdatecomponents! = Nil) {
[Scheduleddatecomponents setday: currentdatecomponents. Day + 7];
[Scheduleddatecomponents sethour:];
[Scheduleddatecomponents setminute:0];
[Scheduleddatecomponents setsecond:0];
}
nsdate* scheduleddate = [Calendar datefromcomponents: scheduleddatecomponents];
Localnotification. firedate = scheduleddate;
[[uiapplication sharedapplication]cancelalllocalnotifications];
[[uiapplication sharedapplication]schedulelocalnotification: localnotification];
Simple
Http://stackoverflow.com/questions/10060578/uilocalnotification-fires-immediately-instead-of-at-scheduled-time
Uilocalnotification*Localnotification= [[UilocalnotificationAlloc]Init];Localnotification.Firedate= [NSDate Datewithtimeintervalsincenow:1];localnotification.= @ "Your Alert message" localnotification.= [nstimezone[[uiapplication Sharedapplication] Schedulelocalnotification:localnotification
iOS push local notification