flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
162.97k stars 26.8k forks source link

Issue with canCheckBiometrics #149879

Open JtycEdgeTech opened 2 weeks ago

JtycEdgeTech commented 2 weeks ago

I am using the latest local_auth version which is 2.2.0.

Steps to reproduce

  1. Install app on iOS that uses local_auth
  2. Add Face ID and passcode to device
  3. Turn off passcode and remain Face ID
  4. Run the example MyApp statefulWidget provided and try execute canCheckBiometrics

Expected results

As mentioned in documentation where canCheckBiometrics only indicates whether hardware support is available. Since my device supports biometric authentication, so canCheckBiometrics should always return true.

Actual results

Only after turning off passcode and remain Face ID, canCheckBiometrics return false.

Code sample

Code sample ```dart [Paste your code here] ```

Screenshots or Video

Screenshots / Video demonstration [Upload media here]

Logs

Logs ```console [Paste your logs here] ```

Flutter Doctor output

Doctor output ```console [✓] Flutter (Channel stable, 3.19.5, on macOS 14.5 23F79 darwin-arm64, locale en-MY) • Flutter version 3.19.5 on channel stable at /Users/yongchuan/develop/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 300451adae (2 months ago), 2024-03-27 21:54:07 -0500 • Engine revision e76c956498 • Dart version 3.3.3 • DevTools version 2.31.1 [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) • Android SDK at /Users/yongchuan/Library/Android/sdk • Platform android-34, build-tools 34.0.0 • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 15.4) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 15F31d • CocoaPods version 1.15.2 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 2023.2) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874) [✓] VS Code (version 1.89.1) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.90.0 [✓] Connected device (3 available) • iPhone (mobile) • 00008030-000D24C0349A802E • ios • iOS 17.5.1 21F90 • macOS (desktop) • macos • darwin-arm64 • macOS 14.5 23F79 darwin-arm64 • Chrome (web) • chrome • web-javascript • Google Chrome 125.0.6422.142 [✓] Network resources • All expected network resources are available. • No issues found! ```
darshankawar commented 2 weeks ago

@JtycEdgeTech Check this issue comment and also read the plugin's readMe on the said method to check if it helps further in your case or not.

JtycEdgeTech commented 2 weeks ago

Hi, based on my understanding, the plugin's readMe on the said method mentioned that the method is to check if hardware support is available right? Which means that if device supports biometric (has certain hardwares for biometric enrolment), then canCheckBiometrics should be always returning true regardless of any biometric enrolled or not right?

Screenshot 2024-06-10 at 1 48 45 PM

While for the issue comment, based on my understanding, basically they are exactly the same explanation as in plugin's readMe.

Screenshot 2024-06-10 at 1 52 31 PM

Please kindly correct me if I am wrong ya, thankss!

darshankawar commented 2 weeks ago

Check https://github.com/flutter/flutter/issues/107210#issuecomment-1178167791 for further reference.