application.applicationIconBadgeNumber = 0;
NSCalendar *calendar = [NSCalendar autoupdatingCurrentCalendar];
NSDateComponents *dateComps = [[NSDateComponents alloc] init];
[dateComps setYear:2014];
[dateComps setDay:6];
[dateComps setMonth:3];
[dateComps setDay:7];
[dateComps setWeekday:7];
[dateComps setHour:12];
[dateComps setMinute:53];
[dateComps setSecond:00];
NSDate *date = [calendar dateFromComponents:dateComps];
UILocalNotification *localNotif = [[UILocalNotification alloc]init];
if (localNotif != nil)
{
//noti time
localNotif.fireDate = date;
localNotif.timeZone = [NSTimeZone defaultTimeZone];
localNotif.repeatInterval = NSDayCalendarUnit;
//Payload
localNotif.alertBody = [NSString stringWithFormat:@"date : %@",date];
localNotif.alertAction = @"http://toplogical.blogspot.kr/";
localNotif.soundName = UILocalNotificationDefaultSoundName;
localNotif.applicationIconBadgeNumber = 1;
//Custom Data
NSDictionary *infoDict = [NSDictionary dictionaryWithObject:@"toplogic" forKey:@"page"];
localNotif.userInfo = infoDict;
//Local Notification add
[[UIApplication sharedApplication] scheduleLocalNotification:localNotif];
}
댓글 없음:
댓글 쓰기