From 02af9297448b3a8a8c8ed19676eedac7e85ff5e0 Mon Sep 17 00:00:00 2001 From: dankito Date: Fri, 23 Oct 2020 01:25:09 +0200 Subject: [PATCH] As found in documentation (die reine Schule) checking canEvaluatePolicy() first --- .../Security/BiometricAuthenticationService.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ui/BankingiOSApp/BankingiOSApp/Security/BiometricAuthenticationService.swift b/ui/BankingiOSApp/BankingiOSApp/Security/BiometricAuthenticationService.swift index f6cec415..eaa37ba8 100644 --- a/ui/BankingiOSApp/BankingiOSApp/Security/BiometricAuthenticationService.swift +++ b/ui/BankingiOSApp/BankingiOSApp/Security/BiometricAuthenticationService.swift @@ -7,7 +7,13 @@ class BiometricAuthenticationService { var biometryType: LABiometryType { - localAuthenticationContext.biometryType + var error: NSError? + + if localAuthenticationContext.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: &error) { + return localAuthenticationContext.biometryType + } + + return .none } var isFaceIDSupported: Bool {