UILocalNotification *notification=[[UILocalNotification alloc] init]; if (notification!=nil) {//判断系统是否支持本地通知 notification.fireDate = [NSDate dateWithTimeIntervalSince1970:16*60*60*24];//本次开启立即执行的周期 notification.repeatInterval=kCFCalendarUnitWeekday;//循环通知的周期 notification.timeZone=[NSTimeZone defaultTimeZone]; notification.alertBody=@"哇哇哇";//弹出的提示信息 notification.applicationIconBadgeNumber=0; //应用程序的右上角小数字 notification.soundName= UILocalNotificationDefaultSoundName;//本地化通知的声音 //notification.alertAction = NSLocalizedString(@"美女呀", nil); //弹出的提示框按钮 notification.hasAction = NO; [[UIApplication sharedApplication] scheduleLocalNotification:notification]; }
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/3298.html