-
-
Save GxocT/21444d7095ce167b2699451e0ab7d0d8 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
UNUserNotificationCenter.current().getNotificationSettings { | |
(settings) in | |
guard settings.authorizationStatus == .authorized else { return } | |
let content = UNMutableNotificationContent() | |
content.title = "Cat Title" | |
content.subtitle = "Cat Subtitle" | |
content.body = "Cat Body" | |
content.sound = .default | |
content.categoryIdentifier = "category-simple" | |
let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 3, repeats: false) | |
let uuid = UUID().uuidString | |
let request = UNNotificationRequest(identifier: uuid, content: content, trigger: trigger) | |
UNUserNotificationCenter.current().add(request, withCompletionHandler: { | |
(error) in | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment