码迷,mamicode.com
首页 > 移动开发 > 详细

IOS---通知

时间:2015-04-30 15:59:08      阅读:134      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!