[+] 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() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
UNUserNotificationCenter.current().requestAuthorization(options: [.alert]) { UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .badge, .sound]) { success, error in
(granted, error) in if success {
if granted { print("All set!")
print("Authorized Notifications") } else if let error = error {
} else { print(error.localizedDescription)
print("Error: No notification access") }
} }
}
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
} }