application.applicationIconBadgeNumber = 0;//应用程序右上角的数字=0(消失)
[[UIApplication sharedApplication] cancelAllLocalNotifications];//取消所有的通知
UILocalNotification *notification=[[UILocalNotification alloc] init];
if (notification!=nil) {//判断系统是否支持本地通知
notification.fireDate=[NSDate dateWithTimeIntervalSinceNow:10];//本次开启立即执行的周期
notification.repeatInterval=kCFCalendarUnitDay;//循环通知的周期
notification.timeZone=[NSTimeZone defaultTimeZone];
notification.alertBody=@"哇,我的女神,你怎了?";//弹出的提示信息
notification.applicationIconBadgeNumber=1; //应用程序的右上角小数字
notification.soundName= UILocalNotificationDefaultSoundName;//本地化通知的声音
notification.alertAction = NSLocalizedString(@"营救女神!", nil); //弹出的提示框按钮
[[UIApplication sharedApplication] scheduleLocalNotification:notification];
}
}
本地通知
精选 转载
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
IOS 本地通知 UILocalNotification
IOS 本地通知 UILocalNotification ---用程序挂起、复原与终止—IOS开发
IOS 本地通知 UILocalNotification