• 카테고리

    질문 & 답변
  • 세부 분야

    모바일 앱 개발

  • 해결 여부

    미해결

로컬 유저 노티피케이션에서 반복 주기 설정 방법 문의 드립니다.

21.11.29 20:12 작성 조회수 371

0

안녕하세요?

유저노티피케이션에서 기능 구현을 하다가 며칠째 답을 못 찾아서 결국 문의 드립니다...

아이폰의 기본 앱인 "미리 알림" 앱처럼 시작 날짜와 사용자가 설정한 반복 주기 알람을 구현하려고 시도하고 있습니다.

매일, 매주, 매달, 매분기, 매년은 아래 개발자 문서대로 이용하면 될 것 같은데

----------------------

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 = 8date.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이 폐기된 후에는 같은 기능을 도저히 못 찾겠어서 질문 드립니다.

 

감사합니다.

 

 

답변 0

답변을 작성해보세요.

답변을 기다리고 있는 질문이에요.
첫번째 답변을 남겨보세요!