mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
feat: add support for unlocking with Apple Watch (#36935)
This commit is contained in:
@@ -425,9 +425,10 @@ std::string SystemPreferences::GetSystemColor(gin_helper::ErrorThrower thrower,
|
||||
|
||||
bool SystemPreferences::CanPromptTouchID() {
|
||||
base::scoped_nsobject<LAContext> context([[LAContext alloc] init]);
|
||||
if (![context
|
||||
canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics
|
||||
error:nil])
|
||||
LAPolicy auth_policy = LAPolicyDeviceOwnerAuthenticationWithBiometrics;
|
||||
if (@available(macOS 10.15, *))
|
||||
auth_policy = LAPolicyDeviceOwnerAuthenticationWithBiometricsOrWatch;
|
||||
if (![context canEvaluatePolicy:auth_policy error:nil])
|
||||
return false;
|
||||
if (@available(macOS 10.13.2, *))
|
||||
return [context biometryType] == LABiometryTypeTouchID;
|
||||
|
||||
Reference in New Issue
Block a user