zoukankan      html  css  js  c++  java
  • Objective-C LocalNotification(本地通知)

      

       // 1.创建一个本地通知
        UILocalNotification *localNote = [[UILocalNotification alloc] init];
        // 1.1.设置通知发出的时间
        localNote.fireDate = [NSDate dateWithTimeIntervalSinceNow:time];
        // 1.2.设置通知内容
        localNote.alertBody = @"您有一个本地通知";
        // 1.3.设置锁屏时,字体下方显示的一个文字
        localNote.alertAction = @"按下查看详情";
        localNote.hasAction = YES;
        // 1.4.设置启动图片(通过通知打开的)
        localNote.alertLaunchImage = @"AppIcon.png";
        // 1.5.设置通过到来的声音
        localNote.soundName = UILocalNotificationDefaultSoundName;
        // 1.6.设置应用图标左上角显示的数字
        localNote.applicationIconBadgeNumber = 1;
        localNote.userInfo = @{@"noteId" : @"localNote", @"msg" : @"success"};
        // 2.执行通知
        [[UIApplication sharedApplication] scheduleLocalNotification:localNote];
    

      

  • 相关阅读:
    P1141零一迷宫
    P1219八皇后
    P1233木棍加工
    三 Struts2 添加返回数据
    二 Struts2 接收数据
    一 Struts2 开发流程
    12-tinyMCE文本编辑器+图片上传预览+页面倒计时自动跳转
    11-page分页原理
    10-ajax技术简介
    9-文件上传和下载
  • 原文地址:https://www.cnblogs.com/metersj/p/7551330.html
Copyright © 2011-2022 走看看