In iOS 10, how can I configure local notifications to be repeated in minutes, starting from a specific date / time.
For example, initiate a local notification every 15 minutes, starting at 11:00 on September 8? Suppose below DateTimeReminder.date is 09/08 11 a.m.
let dateStart = self.dateTimeNotif.date
let notifTrigger = UNCalendarNotificationTrigger.init(dateMatching: NSCalendar.current.dateComponents([.day, .month, .year, .hour, .minute], from: dateStart), repeats: true)
let notificationRequest = UNNotificationRequest(identifier: "MYNOTIF", content: notifContent, trigger: notifTrigger)
UNUserNotificationCenter.current().add(notificationRequest, withCompletionHandler: nil)
With the code above, I have the opportunity to schedule at a specific minute of every hour, at a specific hour of every day, and so on. But how do I turn it into "every" x "minutes"? Any help is appreciated.
A similar question is - How to set NSCalendarUnitMinute repeatInterval in UserNotifications iOS 10?
source
share