fix scheduling notifications

This commit is contained in:
Trey t
2022-01-23 17:57:13 -06:00
parent 94bfe29022
commit 8cff6843cc

View File

@@ -29,6 +29,9 @@ class LocalNotification {
} }
public class func scheduleReminder(atTime time: Date, withTitle title: String) { public class func scheduleReminder(atTime time: Date, withTitle title: String) {
LocalNotification.testIfEnabled(completion: { result in
switch result{
case .success(_):
let _ = LocalNotification.createNotificationCategory() let _ = LocalNotification.createNotificationCategory()
let notificationContent = UNMutableNotificationContent() let notificationContent = UNMutableNotificationContent()
@@ -52,6 +55,11 @@ class LocalNotification {
print(theError.localizedDescription) print(theError.localizedDescription)
} }
} }
case .failure(_):
// Todo: show enable this
break
}
})
} }
private class func createNotificationCategory() -> UNNotificationCategory { private class func createNotificationCategory() -> UNNotificationCategory {