I'm trying to allow the user to schedule notifications to open the app at a certain time every day. So far, I've been able to schedule the first notification by calculating the time between now and when the user selects, and scheduling a notification in X seconds. However, is there a way that I can then set that notification to repeat every day? Here's part of my code in case you're confused:
let newTime: Double = Double(totalDifference)
let notifTrigger = UNTimeIntervalNotificationTrigger(timeInterval: newTime, repeats: false)
let request = UNNotificationRequest(identifier: "openApp", content: notif, trigger: notifTrigger)
UNUserNotificationCenter.current().add(request, withCompletionHandler: { error in
if error != nil {
print(error!)
completion(false)
} else {
completion(true)
}
})
Any help is much appreciated