COVIDSafe code from version 1.4 (updates) (#4)

This commit is contained in:
COVIDSafe Support 2020-05-27 16:22:34 +10:00 committed by GitHub
parent b2e0c5b34c
commit 6b262be150
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 140 additions and 144 deletions

View file

@ -9,46 +9,8 @@ import UIKit
import UserNotifications
class OnboardingStep2ViewController: UIViewController {
@IBAction func allowPermissionsBtn(_ sender: UIButton) {
requestAllPermissions()
}
@IBAction func onBackTapped(_ sender: UIButton) {
self.navigationController?.popViewController(animated: true)
}
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
// Show the navigation bar on other view controllers
}
func requestAllPermissions() {
UNUserNotificationCenter.current() // 1
.requestAuthorization(options: [.alert, .sound, .badge]) { // 2
granted, error in
BluetraceManager.shared.turnOn()
UserDefaults.standard.set(true, forKey: "allowedPermissions")
print("Permissions granted: \(granted)") // 3
}
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
}
*/
}