UILocalNotification

application.applicationIconBadgeNumber = 0;
    [[UIApplication sharedApplication] cancelAllLocalNotifications];
    UILocalNotification *notification = [[UILocalNotification alloc] init];
    if (notification) {
        notification.fireDate = [NSDate dateWithTimeIntervalSinceNow:kCFCalendarUnitDay];
        notification.repeatInterval = kCFCalendarUnitDay;
        notification.timeZone = [NSTimeZone defaultTimeZone];
        notification.alertBody = @"test";
        notification.applicationIconBadgeNumber = 1;
        notification.soundName = UILocalNotificationDefaultSoundName;
        notification.alertAction = NSLocalizedString(@"test1", nil);
        [[UIApplication sharedApplication] scheduleLocalNotification:notification];
    }

你可能感兴趣的:(UILocalNotification)