I have an iPhone App in which i am using to fire UILocalnotification daily, Weekly and Yearly is there any good tutorial for that am using this code to set the notification
- (void)alertSelector:(NSString *)AlertTitle WithFiringTime:(NSDate *)date{
UILocalNotification *localNotification = [[[UILocalNotification alloc] init] autorelease];
if (!localNotification)
return;
// Set the fire date/time
[localNotification setFireDate:date];
[localNotification setTimeZone:[NSTimeZone defaultTimeZone]];
// Create a payload to go along with the notification
NSDictionary *data = [NSDictionary dictionaryWithObject:date forKey:@"payload"];
[localNotification setUserInfo:data];
// Setup alert notification
[localNotification setAlertBody:AlertTitle];
[localNotification setAlertAction:@"View"];
[localNotification setHasAction:YES];
[UILocalNotification setBadge];
开发者_开发知识库
// localNotification.soundName = UILocalNotificationDefaultSoundName;
// localNotification.soundName=@"voice.aif";
// Schedule the notification
[[UIApplication sharedApplication] scheduleLocalNotification:localNotification];
}
thankx
Maybe this tutorial helps...
精彩评论