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
最新推荐文章于 2021-08-12 21:19:02 发布