-
-
Save lmiller1990/370e41005eba96d7905e71feab36a094 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func scheduleNotifications() -> Void { | |
for notification in notifications { | |
let content = UNMutableNotificationContent() | |
content.title = notification.title | |
let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 5, repeats: false) | |
let request = UNNotificationRequest(identifier: notification.id, content: content, trigger: trigger) | |
UNUserNotificationCenter.current().add(request) { error in | |
guard error == nil else { return } | |
print("Scheduling notification with id: \(notification.id)") | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment