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];
      }
    }
  • 相关阅读:
    zabbix邮件报警
    简单的带权随机算法
    一、向量
    C#遍历DataSet
    旅游(二)——广州
    旅游(一)——潮州
    LoRa术语
    Linux基础(一)
    Git(二)_基本命令
    Git使用(一)——Cygwin
  • 原文地址:https://www.cnblogs.com/fuunnyy/p/5387449.html
Copyright © 2011-2022 走看看