mirror of
https://github.com/AU-COVIDSafe/mobile-ios.git
synced 2025-04-19 04:55:19 +00:00
COVIDSafe code from version 1.1
This commit is contained in:
commit
3640e52eb2
330 changed files with 261540 additions and 0 deletions
54
CovidSafe/OnboardingStep2ViewController.swift
Normal file
54
CovidSafe/OnboardingStep2ViewController.swift
Normal file
|
@ -0,0 +1,54 @@
|
|||
//
|
||||
// OnboardingStep2ViewController.swift
|
||||
// CovidSafe
|
||||
//
|
||||
// Copyright © 2020 Australian Government. All rights reserved.
|
||||
//
|
||||
|
||||
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.
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue