Hello I have this function which I am calling from DIspatchSource Timer when App is in background and the timer is running for every 5 mins
private func scheduleNotification() {
NotificationManager.shared.removeAllPendingNotifications()
let content = UNMutableNotificationContent()
content.title = "######"
content.body = "##### "
content.sound = UNNotificationSound.default
let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 5, repeats: false)
let request = UNNotificationRequest(identifier: UUID().uuidString, content: content, trigger: trigger)
UNUserNotificationCenter.current().add(request) { error in
if let error = error {
print("Error scheduling notification: (error)")
}
}
}
And The local Notification is not getting triggered sometimes. Can anyone please help with this issue .Is this expected or do I need to modify the qos level or anything.Any advice would be appreciated
I Have tried to dispatch from a global queue and increased the trigger Time but still no use
Vishwa Karnati is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.