Skip to content

[local_auth][iOS] Plugin throw NotAvailable exception in cases of No Permission, Lockout, and Face not recognized  #148942

@HeynSekk

Description

@HeynSekk

Steps to reproduce

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
}

Expected results

it should throw with different error codes.

Actual results

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.

Code sample

Code sample
//please run above code snippet

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
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!

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listp: local_authPlugin for local authentificationpackageflutter/packages repository. See also p: labels.platform-iosiOS applications specificallyteam-iosOwned by iOS platform teamtriaged-iosTriaged by iOS platform team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions