Skip to content

Commit 98f6378

Browse files
committed
Use the latest LAPolicy for iOS9+ which allows a fallback to using the device pin code
1 parent b6a8578 commit 98f6378

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

LTHPasscodeViewController/LTHPasscodeViewController.m

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,13 @@ - (void)_setupFingerPrint {
353353
if (!self.biometricsContext && _allowUnlockWithBiometrics && !_useFallbackPasscode) {
354354
self.biometricsContext = [[LAContext alloc] init];
355355

356+
LAPolicy policy = LAPolicyDeviceOwnerAuthenticationWithBiometrics;
357+
if (@available(iOS 9.0, *)) {
358+
policy = LAPolicyDeviceOwnerAuthentication;
359+
}
360+
356361
NSError *error = nil;
357-
if ([self.biometricsContext canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&error]) {
362+
if ([self.biometricsContext canEvaluatePolicy:policy error:&error]) {
358363
if (error) {
359364
return;
360365
}
@@ -370,7 +375,7 @@ - (void)_setupFingerPrint {
370375
_animatingView.hidden = YES;
371376

372377
// Authenticate User
373-
[self.biometricsContext evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics
378+
[self.biometricsContext evaluatePolicy:policy
374379
localizedReason:LTHPasscodeViewControllerStrings(self.biometricsDetailsString)
375380
reply:^(BOOL success, NSError *error) {
376381

0 commit comments

Comments
 (0)