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

      

  • 相关阅读:
    BZOJ3193: [JLOI2013]地形生成
    ARG102E:Stop. Otherwise...
    51NOD1847:奇怪的数学题
    大型大常数多项式模板(已卡常...)
    CF932G Palindrome Partition
    51nod1538:一道难题(常系数线性递推/Cayley-Hamilton定理)
    HTML——meta标签
    HTTP 格式
    Node.js——Async
    设计模式——外观模式
  • 原文地址:https://www.cnblogs.com/metersj/p/7551330.html
Copyright © 2011-2022 走看看