首页 > 移动平台 > 详细

IOS---通知

时间:2015-04-30 15:57:53      阅读:209      评论:0      收藏:0      [点我收藏+]

 

http://www.cnblogs.com/kenshincui/p/4168532.html

本地通知

  UILocalNotification *local=[[UILocalNotification alloc]init];

    local.fireDate=[NSDate dateWithTimeIntervalSinceNow:10.0f];

    local.alertBody=@"该吃药了!!";

    [[UIApplication sharedApplication] scheduleLocalNotification:local];

 

iOS8.0之后a中需要用户同意

Application中写

    float sysVersion=[[UIDevice currentDevice]systemVersion].floatValue;

    if (sysVersion>=8.0) {

        UIUserNotificationType type=UIUserNotificationTypeBadge | UIUserNotificationTypeAlert | UIUserNotificationTypeSound;

        UIUserNotificationSettings *setting=[UIUserNotificationSettings settingsForTypes:type categories:nil];

        [[UIApplication sharedApplication]registerUserNotificationSettings:setting];

    }

IOS---通知

原文:http://www.cnblogs.com/lvchenhao/p/4468817.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!