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

    }

原文地址:https://www.cnblogs.com/lvchenhao/p/4468817.html