[+] Authorize badge and sound for alerts too
This commit is contained in:
@@ -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.
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user