[local_auth] fix: isDeviceSupported on ios (#5125)

Fixes: https://github.com/flutter/flutter/issues/116179
diff --git a/packages/local_auth/local_auth_ios/CHANGELOG.md b/packages/local_auth/local_auth_ios/CHANGELOG.md
index cc16bf0..f57dc70 100644
--- a/packages/local_auth/local_auth_ios/CHANGELOG.md
+++ b/packages/local_auth/local_auth_ios/CHANGELOG.md
@@ -1,5 +1,6 @@
-## NEXT
+## 1.1.7
 
+* Implements `isDeviceSupported`.
 * Updates minimum iOS version to 12.0 and minimum Flutter version to 3.16.6.
 
 ## 1.1.6
diff --git a/packages/local_auth/local_auth_ios/example/ios/RunnerTests/FLTLocalAuthPluginTests.m b/packages/local_auth/local_auth_ios/example/ios/RunnerTests/FLTLocalAuthPluginTests.m
index a2c9690..918dd51 100644
--- a/packages/local_auth/local_auth_ios/example/ios/RunnerTests/FLTLocalAuthPluginTests.m
+++ b/packages/local_auth/local_auth_ios/example/ios/RunnerTests/FLTLocalAuthPluginTests.m
@@ -490,12 +490,14 @@
   XCTAssertNil(error);
 }
 
-// TODO(stuartmorgan): Make this multiple tests when fixing
-// https://github.com/flutter/flutter/issues/116179
-// Currently it just always returns true.
-- (void)testIsDeviceSupported {
+- (void)testIsDeviceSupportedHandlesSupported {
+  id mockAuthContext = OCMClassMock([LAContext class]);
+  OCMStub([mockAuthContext canEvaluatePolicy:LAPolicyDeviceOwnerAuthentication
+                                       error:[OCMArg setTo:nil]])
+      .andReturn(YES);
   FLTLocalAuthPlugin *plugin = [[FLTLocalAuthPlugin alloc]
-      initWithContextFactory:[[StubAuthContextFactory alloc] initWithContexts:@[]]];
+      initWithContextFactory:[[StubAuthContextFactory alloc]
+                                 initWithContexts:@[ mockAuthContext ]]];
 
   FlutterError *error;
   NSNumber *result = [plugin isDeviceSupportedWithError:&error];
@@ -503,6 +505,21 @@
   XCTAssertNil(error);
 }
 
+- (void)testIsDeviceSupportedHandlesUnsupported {
+  id mockAuthContext = OCMClassMock([LAContext class]);
+  OCMStub([mockAuthContext canEvaluatePolicy:LAPolicyDeviceOwnerAuthentication
+                                       error:[OCMArg setTo:nil]])
+      .andReturn(NO);
+  FLTLocalAuthPlugin *plugin = [[FLTLocalAuthPlugin alloc]
+      initWithContextFactory:[[StubAuthContextFactory alloc]
+                                 initWithContexts:@[ mockAuthContext ]]];
+
+  FlutterError *error;
+  NSNumber *result = [plugin isDeviceSupportedWithError:&error];
+  XCTAssertFalse([result boolValue]);
+  XCTAssertNil(error);
+}
+
 // Creates an FLAAuthStrings with placeholder values.
 - (FLAAuthStrings *)createAuthStrings {
   return [FLAAuthStrings makeWithReason:@"a reason"
diff --git a/packages/local_auth/local_auth_ios/ios/Classes/FLTLocalAuthPlugin.m b/packages/local_auth/local_auth_ios/ios/Classes/FLTLocalAuthPlugin.m
index 4962c39..3ac8ebe 100644
--- a/packages/local_auth/local_auth_ios/ios/Classes/FLTLocalAuthPlugin.m
+++ b/packages/local_auth/local_auth_ios/ios/Classes/FLTLocalAuthPlugin.m
@@ -146,9 +146,8 @@
 
 - (nullable NSNumber *)isDeviceSupportedWithError:
     (FlutterError *_Nullable __autoreleasing *_Nonnull)error {
-  // TODO(stuartmorgan): Fix this to check for biometrics or passcode; see
-  // https://github.com/flutter/flutter/issues/116179
-  return @YES;
+  LAContext *context = [self.authContextFactory createAuthContext];
+  return @([context canEvaluatePolicy:LAPolicyDeviceOwnerAuthentication error:NULL]);
 }
 
 #pragma mark Private Methods
diff --git a/packages/local_auth/local_auth_ios/pubspec.yaml b/packages/local_auth/local_auth_ios/pubspec.yaml
index fca908e..b49abb4 100644
--- a/packages/local_auth/local_auth_ios/pubspec.yaml
+++ b/packages/local_auth/local_auth_ios/pubspec.yaml
@@ -2,7 +2,7 @@
 description: iOS implementation of the local_auth plugin.
 repository: https://github.com/flutter/packages/tree/main/packages/local_auth/local_auth_ios
 issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+local_auth%22
-version: 1.1.6
+version: 1.1.7
 
 environment:
   sdk: ^3.2.3