UILocalNotification
作者:
L柠_檬 | 来源:发表于
2016-08-19 14:26 被阅读29次UILocalNotification *notification =[[UILocalNotification alloc]init];
notification.fireDate =[NSDate dateWithTimeIntervalSinceNow:1];
notification.repeatInterval =kCFCalendarUnitDay;
notification.soundName =UILocalNotificationDefaultSoundName;
notification.alertBody =@"记得吃饭";
notification.applicationIconBadgeNumber =1;
notification.userInfo=[NSDictionary dictionaryWithObject:@"1" forKey:@"identify"];
[[UIApplication sharedApplication]scheduleLocalNotification:notification];
- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification {
if (notification) {
NSLog(@"[%@]",notification.alertBody);
application.applicationIconBadgeNumber=0;
}
}
本文标题:UILocalNotification
本文链接:https://www.haomeiwen.com/subject/yaybsttx.html
网友评论