I have a SwiftUI Timer App and I want the user to get notified when the timer runs out. I currently do this with just a local notification.
let content = UNMutableNotificationContent()
content.title = String(localized: "proTimer")
content.body = String(localized: "\(name)IstAbgelaufen")
content.sound = UNNotificationSound(named: UNNotificationSoundName("\(sound).wav"))
let trigger = UNTimeIntervalNotificationTrigger(timeInterval: endDate!.timeIntervalSince(Date.now), repeats: false)
let request = UNNotificationRequest(identifier: id.uuidString, content: content, trigger: trigger)
UNUserNotificationCenter.current().add(request)
Unfortunately, if the user has enabled Do Not Disturb, this notification will no longer be delivered. What can I do against it? Is there something like "urgent notifications"?