Skip to content

[local_auth] Document how to eliminate the fallback button in biometrics dialog on iOS via localizedFallbackTitle #148947

@tobolski

Description

@tobolski

Steps to reproduce

I'm calling a local_auth dialog with AuthenticationOptions(biometricOnly: true).

When calling it on iOS it displays FaceID dialog.
If the face recognition fails two times, it displays popup:
image

Expected results

"Enter password" option should not be displayed if biometricOnly is set to true.

Actual results

Tapping on "Enter password" causes an exception:

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(NotAvailable, Authentication canceled., com.apple.LocalAuthentication, null)

Code sample

LocalAuthentication code sample
final auth = LocalAuthentication();
final result = await auth.authenticate(
  localizedReason: 'Authenticate to access the app',
  options: const AuthenticationOptions(biometricOnly: true),
);

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.19.6, on macOS 14.4.1 23E224 darwin-arm64, locale en-PL)
    • Flutter version 3.19.6 on channel stable at /Users/xxx/git/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 54e66469a9 (5 weeks ago), 2024-04-17 13:08:03 -0700
    • Engine revision c4cd48e186
    • Dart version 3.3.4
    • DevTools version 2.31.1

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/xxx/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.7+0-17.0.7b1000.6-10550314)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15C500b
    • CocoaPods version 1.15.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2023.1)
    • 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.7+0-17.0.7b1000.6-10550314)

[✓] VS Code (version 1.89.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (5 available)
    • sdk gphone64 arm64 (mobile)          • emulator-5554                        • android-arm64  • Android 13 (API 33) (emulator)
    • iPhone 15 (mobile)                   • 101FE7E4-58F6-4DA3-92C5-B2F838BAE888 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-17-2 (simulator)
    • macOS (desktop)                      • macos                                • darwin-arm64   • macOS 14.4.1 23E224 darwin-arm64
    • Chrome (web)                         • chrome                               • web-javascript • Google Chrome 124.0.6367.210

[✓] Network resources
    • All expected network resources are available.

• No issues found!

Metadata

Metadata

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 teamworkaround availableThere is a workaround available to overcome the issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions