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];
    

      

  • 相关阅读:
    MARGIN-BEFORE MARGIN-AFTER MARGIN-START MARGIN-END
    原生js写简单轮播图方式1-从左向右滑动
    标准模式与怪异模式
    XMLHTTPRequest
    【Github教程】史上最全github使用方法:github入门到精通
    月亮
    星星dom
    css中链接的4个状态 link、visited 、hover、active 顺序与设置
    CSS animation-timing-function 属性中的 steps() 与 step-start,step-end
    jQuery.Deferred对象
  • 原文地址:https://www.cnblogs.com/metersj/p/7551330.html
Copyright © 2011-2022 走看看