UILocalNotification

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;
    }
}
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 大雨酩酊风随影 布衫轻扬 孤决踏却泠泠箫声
    叁號站阅读 1,540评论 1 1
  • 今天想和大家聊聊我从加入Tom教练口才辅导到现在一个多月的时间的心理变化。 开班 加入的那天印象很深刻。本来教练是...
    江智勇阅读 3,173评论 0 0
  • 纳西族妇女传统服饰里的披肩,有人认为其形状和装饰图案是纳西族崇拜青蛙的遗风。首先,羊皮披肩以纯黑色为佳,剪裁时要摹...
    莫__天阅读 2,828评论 0 0
  • 1.自我意识正确 2.人际关系协调 3.社会效应良好 4.性别角色分化 5.情绪积极稳定 6.人格结构完整 中学生...
    你叫不醒一个装睡的人阅读 3,110评论 0 0

友情链接更多精彩内容