From d0ab0ba81d8769dd8202dbece2afb51af41f1857 Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Sun, 17 Jan 2021 14:57:01 -0500 Subject: [PATCH] [+] Authorize badge and sound for alerts too --- ProjectClock/TestingViewController.swift | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/ProjectClock/TestingViewController.swift b/ProjectClock/TestingViewController.swift index 2fa5c0e..13e9b07 100644 --- a/ProjectClock/TestingViewController.swift +++ b/ProjectClock/TestingViewController.swift @@ -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. }