이전에 내 응용 프로그램에서 알림 목적으로 UILocalNotification
을 사용하고 있습니다.UNNotificationRequest에서 반복 간격과 발동 날짜를 설정하는 방법
하지만 위의 API는 iOS 10.0에서 사용되지 않으므로 UserNotifications Framework의 UNNotificationRequest
을 사용해야합니다.
는 UILocalNotification
사용 나는 아래로 화재 일뿐만 아니라 반복 간격을 설정 할 수 있었다 : 나는 통지가 불을 얻을 것이다 때 내일 날짜를 설정 할 수있어 위의 코드에서
UILocalNotification *localNotification = [[UILocalNotification alloc] init];
NSDate *tomorrow = [NSDate dateWithTimeInterval:(24*60*60) sinceDate:[NSDate date]];
localNotification.fireDate = tomorrow;
if(repeatUnit!=0){
localNotification.repeatInterval = NSWeekCalendarUnit;
}
[[UIApplication sharedApplication] scheduleLocalNotification:localNotification];
또한 나는 반복을 설정했다 화재 일로부터 1 주일 간격으로 시작됩니다.
UserNotifications Framework의 UNNotificationRequest
을 사용하여이를 달성 할 수있는 방법.
새 API에서는 및 UNTimeintervalNotificationTrigger
트리거를 사용하여 UNNotificationRequest
을 시작할 수 있습니다.
사용할 수있는 방법이 있습니까? UILocalNotification
처럼 설정할 수 있습니까?
니스. 고맙습니다. –