IOS---通知

 

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

    }

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。