zoukankan      html  css  js  c++  java
  • 将推送过来的远程推送信息转成本地推送

    + (void)startLocalNotification:(NSString *)msg
    {    
        UILocalNotification *notification = [[UILocalNotification alloc] init];
        if (notification!=nil)
     {
            NSDate *now=[NSDate new];
            notification.fireDate=[now dateByAddingTimeInterval:1]; //触发通知的时间
            notification.repeatInterval=0; //循环次数,kCFCalendarUnitWeekday一周一次
            notification.timeZone=[NSTimeZone defaultTimeZone];
            notification.soundName = UILocalNotificationDefaultSoundName;
            notification.alertBody=msg;
            notification.alertAction = @"打开";  //提示框按钮
            notification.hasAction = YES; //是否显示额外的按钮,为no时alertAction消失
            notification.applicationIconBadgeNumber = 0; //设置app图标右上角的数字
            [[UIApplication sharedApplication] scheduleLocalNotification:notification];
      }
    }
  • 相关阅读:
    日期帮助类
    校验帮助类
    缓存帮助类
    数据转换帮助类
    枚举帮助类
    sql 不常用的知识点记录
    反射实例化不同类型的实例
    xml读取
    读取字段别名
    动态类型赋值处理
  • 原文地址:https://www.cnblogs.com/fuunnyy/p/5387449.html
Copyright © 2011-2022 走看看