로컬 유저 노티피케이션에서 반복 주기 설정 방법 문의 드립니다.
미해결
야곰의 iOS 프로그래밍
안녕하세요? 유저노티피케이션에서 기능 구현을 하다가 며칠째 답을 못 찾아서 결국 문의 드립니다... 아이폰의 기본 앱인 "미리 알림" 앱처럼 시작 날짜와 사용자가 설정한 반복 주기 알람을 구현하려고 시도하고 있습니다. 매일, 매주, 매달, 매분기, 매년은 아래 개발자 문서대로 이용하면 될 것 같은데 ---------------------- Listing 1 creates a trigger that delivers its notification every morning at 8:30. The repeating behavior is achieved by specifying true for the repeats parameter when creating the trigger. Listing 1 Creating a trigger that repeats at a specific time var date = DateComponents () date.hour = 8 date.minute = 30 let trigger = UNCalendarNotificationTrigger (dateMatching: date, repeats: true ) ---------------------- "미리 알림" 앱의 사용자 설정 반복에서처럼 특정 날짜를 시작으로 2일마다, 5주마다, 6달, 3년마다 등 원하는 주기로 노티를 뜨게 하는 방법을 전혀 모르겠네요. TimeInterval Notification도 아래 처럼 시작 날짜가 무조건 현재인 듯 하고 도저히 구현 방안을 모르겠습니다. -------------- Listing 1 Creating a trigger that fires in 30 minutes // Fire in 30 minutes (60 seconds times 30) let trigger = UNTimeIntervalNotificationTrigger (timeInterval: ( 30 * 60 ), repeats: false ) -------------- iOS 10 이전에는 UILocalNotification()에서 fireDate과 repeatInterval을 사용하였다는 내용은 찾았는데 UILocalNotification이 폐기된 후에는 같은 기능을 도저히 못 찾겠어서 질문 드립니다. 감사합니다.
- 로컬유저노티피케이션
- swift
- 알람반복주기
- ios





