From e0fb3ced685a320e0203c9e99c1f8b5f6111303b Mon Sep 17 00:00:00 2001 From: Aaron Date: Sun, 24 Jan 2021 18:37:57 -0500 Subject: [PATCH] Moved notification permission request to initial VC --- ProjectClock/AlarmViewController.swift | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ProjectClock/AlarmViewController.swift b/ProjectClock/AlarmViewController.swift index b2d847f..04800f6 100644 --- a/ProjectClock/AlarmViewController.swift +++ b/ProjectClock/AlarmViewController.swift @@ -9,6 +9,15 @@ class AlarmViewController: UIViewController { super.viewDidLoad() + //Get notification permissions from user + UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .badge, .sound]) { success, error in + if success { + print("All set!") + } else if let error = error { + print(error.localizedDescription) + } + } + // Assign table delegate and data source AlarmViewController.staticTable = table table.delegate = self