Skip to content

Commit af5c865

Browse files
fix: isDeviceSupported on ios
1 parent 68eedfd commit af5c865

File tree

5 files changed

+17
-5
lines changed

5 files changed

+17
-5
lines changed

packages/local_auth/local_auth/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 2.1.8
2+
3+
* Implement isDeviceSupported for ios.
4+
15
## 2.1.7
26

37
* Adds pub topics to package metadata.

packages/local_auth/local_auth/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: Flutter plugin for Android and iOS devices to allow local
33
authentication via fingerprint, touch ID, face ID, passcode, pin, or pattern.
44
repository: https://github.com/flutter/packages/tree/main/packages/local_auth/local_auth
55
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+local_auth%22
6-
version: 2.1.7
6+
version: 2.1.8
77

88
environment:
99
sdk: ">=3.0.0 <4.0.0"

packages/local_auth/local_auth_ios/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.1.5
2+
3+
* Implement isDeviceSupported for ios.
4+
15
## 1.1.4
26

37
* Adds pub topics to package metadata.

packages/local_auth/local_auth_ios/ios/Classes/FLTLocalAuthPlugin.m

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,13 @@ - (nullable NSNumber *)deviceCanSupportBiometricsWithError:
147147

148148
- (nullable NSNumber *)isDeviceSupportedWithError:
149149
(FlutterError *_Nullable __autoreleasing *_Nonnull)error {
150-
// TODO(stuartmorgan): Fix this to check for biometrics or passcode; see
151-
// https://github.com/flutter/flutter/issues/116179
152-
return @YES;
150+
LAContext *context = [[LAContext alloc] init];
151+
NSError *authError = nil;
152+
if ([context canEvaluatePolicy:LAPolicyDeviceOwnerAuthentication error:&authError]) {
153+
return @YES;
154+
} else {
155+
return @NO;
156+
}
153157
}
154158

155159
#pragma mark Private Methods

packages/local_auth/local_auth_ios/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: local_auth_ios
22
description: iOS implementation of the local_auth plugin.
33
repository: https://github.com/flutter/packages/tree/main/packages/local_auth/local_auth_ios
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+local_auth%22
5-
version: 1.1.4
5+
version: 1.1.5
66

77
environment:
88
sdk: ">=3.0.0 <4.0.0"

0 commit comments

Comments
 (0)