-
Notifications
You must be signed in to change notification settings - Fork 328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Biometrics lock (Lock app with FaceID/TouchID/iOS Password) #2398
Changes from all commits
1afab5a
a7564fb
1d757ca
c56f638
1335665
f85e6ae
9fd70fa
5850f35
ce1f140
96cdfac
fc15eac
b728292
fe07834
6ffe64c
2a9ddda
1f0b692
e051dd4
63c9c46
8c656d3
9f1a418
75982af
27cf8ac
97839c3
77e5077
27e2a63
2bc8f60
072af4e
6674456
eec44b0
5dbb72e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import Eureka | ||
import FirebaseInstallations | ||
import FirebaseMessaging | ||
import PromiseKit | ||
import RealmSwift | ||
import Shared | ||
import UIKit | ||
|
||
class SecurityViewController: HAFormViewController { | ||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
|
||
title = L10n.SettingsDetails.General.Security.title | ||
|
||
form | ||
+++ Section() | ||
<<< SwitchRow("switch", { | ||
$0.title = L10n.SettingsDetails.General.Security.action | ||
$0.value = Current.settingsStore.biometricsRequired | ||
$0.onChange { row in | ||
Current.settingsStore.biometricsRequired = row.value ?? false | ||
bgoncal marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
}) | ||
+++ Section( | ||
footer: L10n.SettingsDetails.General.Security.footer | ||
) | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ enum SettingsRootDataSource { | |
case servers | ||
case location | ||
case notifications | ||
case security | ||
case actions | ||
case sensors | ||
case complications | ||
|
@@ -37,6 +38,7 @@ enum SettingsRootDataSource { | |
case .general: return SettingsRootDataSource.general() | ||
case .location: return SettingsRootDataSource.location() | ||
case .notifications: return SettingsRootDataSource.notifications() | ||
case .security: return SettingsRootDataSource.security() | ||
case .actions: return SettingsRootDataSource.actions() | ||
case .sensors: return SettingsRootDataSource.sensors() | ||
case .complications: return SettingsRootDataSource.complications() | ||
|
@@ -95,6 +97,16 @@ enum SettingsRootDataSource { | |
} | ||
} | ||
|
||
private static func security() -> SettingsButtonRow { | ||
SettingsButtonRow { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. how does this work on catalyst? should we hide it or make it available -- if the latter, how do we deal with e.g. the settings scene? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In catalyst it was a bit trickier, because of the "enter background/foreground" thats happens all the time even with the touchID dialog, I treated it with an extra logic to only reauthenticate when the user has reply enter background. When the user open settings scene, the main web view scene locks again until the user unlocks it. Screen.Recording.2023-11-16.at.16.33.08.movRPReplay_Final1700149090.MP4 |
||
$0.title = L10n.SettingsDetails.General.Security.title | ||
$0.icon = .keyChainIcon | ||
$0.presentationMode = .show(controllerProvider: ControllerProvider.callback { | ||
SecurityViewController() | ||
}, onDismiss: nil) | ||
} | ||
} | ||
|
||
private static func actions() -> SettingsButtonRow { | ||
SettingsButtonRow { | ||
$0.title = L10n.SettingsDetails.Actions.title | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
@testable import HomeAssistant | ||
@testable import Shared | ||
import XCTest | ||
|
||
@available(iOS 13, *) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bad merge?