[+] Authorize badge and sound for alerts too

This commit is contained in:
Hykilpikonna
2021-01-17 14:57:01 -05:00
parent a4de8274d4
commit d0ab0ba81d
+7 -8
View File
@@ -13,14 +13,13 @@ class TestingViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
UNUserNotificationCenter.current().requestAuthorization(options: [.alert]) {
(granted, error) in
if granted {
print("Authorized Notifications")
} else {
print("Error: No notification access")
}
}
UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .badge, .sound]) { success, error in
if success {
print("All set!")
} else if let error = error {
print(error.localizedDescription)
}
}
// Do any additional setup after loading the view.
}