Skip to content

Instantly share code, notes, and snippets.

@lmiller1990
Created October 8, 2019 13:14
Show Gist options
  • Save lmiller1990/ae5c4a151739f089ea03b85f733e47bc to your computer and use it in GitHub Desktop.
Save lmiller1990/ae5c4a151739f089ea03b85f733e47bc to your computer and use it in GitHub Desktop.
import UserNotifications
struct Notification {
var id: String
var title: String
}
class LocalNotificationManager {
var notifications = [Notification]()
func requestPermission() -> Void {
UNUserNotificationCenter
.current()
.requestAuthorization(options: [.alert, .badge, .alert]) { granted, error in
if granted == true && error == nil {
// We have permission!
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment