[O] Put notification permission request in the correct location
This commit is contained in:
@@ -25,9 +25,21 @@ class AlarmActivator: UITabBarController
|
|||||||
/// Timer for getting family alarm updates
|
/// Timer for getting family alarm updates
|
||||||
var familyTimer: Timer?
|
var familyTimer: Timer?
|
||||||
|
|
||||||
|
/**
|
||||||
|
Called when the app started
|
||||||
|
*/
|
||||||
override func viewDidLoad()
|
override func viewDidLoad()
|
||||||
{
|
{
|
||||||
start()
|
start()
|
||||||
|
|
||||||
|
// 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)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -8,15 +8,6 @@ class AlarmViewController: UIViewController
|
|||||||
override func viewDidLoad()
|
override func viewDidLoad()
|
||||||
{
|
{
|
||||||
super.viewDidLoad()
|
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
|
// Assign table delegate and data source
|
||||||
AlarmViewController.staticTable = table
|
AlarmViewController.staticTable = table
|
||||||
|
|||||||
@@ -21,15 +21,6 @@ class DebugViewController: EndEditingOnReturn
|
|||||||
super.viewDidLoad()
|
super.viewDidLoad()
|
||||||
wvmStepper.maximumValue = Double(wvms.count - 1)
|
wvmStepper.maximumValue = Double(wvms.count - 1)
|
||||||
|
|
||||||
// Request notification permission
|
|
||||||
UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .badge, .sound]) { success, error in
|
|
||||||
if success {
|
|
||||||
print("All set!")
|
|
||||||
} else if let error = error {
|
|
||||||
print(error.localizedDescription)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// End editing on return
|
// End editing on return
|
||||||
wvmInput.delegate = self
|
wvmInput.delegate = self
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user