We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation .
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement . We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code:
try { return await auth. authenticate ( localizedReason : 'Please authenticate to continue' , options : const AuthenticationOptions ( biometricOnly : true , useErrorDialogs : false , ), ); } on PlatformException catch (e) { //I get NotAvailable here }
it should throw with different error codes.
It throw NotAvailable in the following cases. No Permission case: when I disable face id permission for my app in the device setting.
Lockout case: when i do too many wrong attempt for face id,
Face not recognized case: do auth with wrong face, ios will show a dialog giving you two options 1) Enter Password, 2) Cancel. When tap Cancel, it throw NotAvailable.
//please run above code snippet
[Upload media here]
[Paste your logs here]
Doctor summary (to see all details, run flutter doctor -v): [?] Flutter (Channel stable, 3.19.0, on macOS 14.3.1 23D60 darwin-arm64, locale en-MM) [?] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [?] Xcode - develop for iOS and macOS (Xcode 15.1) [?] Chrome - develop for the web [?] Android Studio (version 2022.3) [?] IntelliJ IDEA Community Edition (version 2023.3.2) [?] VS Code (version 1.89.1) [?] Connected device (3 available) [?] Network resources ? No issues found!
The text was updated successfully, but these errors were encountered:
I don't have an iOS device with FaceID support but I checked this on my device with finger print: iPhone 7, iOS 15.8 . I can see NotAvailable code in the 3rd case on my end.
iPhone 7, iOS 15.8
NotAvailable
flutter: PlatformException(NotAvailable, Authentication canceled., com.apple.LocalAuthentication, null)
I also checked a case by turning off passcode (Settings > Touch ID & Passcode > Turn Passcode Off) and saw the expected code outputs:
flutter: PlatformException(PasscodeNotSet, Passcode is not set., com.apple.LocalAuthentication, null)
I see there was an issue that looks similar to this at #102734 . And it seems to check if Apple's API can return separate error codes for such these case above or not. Maybe NotAvailable error code in the 3rd case is an intended code from Apple's API.
Labeling this for other's insights. This may also relate to #113687 as well.
Sorry, something went wrong.
LouiseHsu
No branches or pull requests