Skip to content

[local_auth] Consider adding API to query for biometrics that are enrolled, even if they aren't available to the app #187438

Description

@Steve-flutter

Steps to reproduce

1.Register Face ID on an iOS device.
2.Disable the Face ID permission for the app.
3. Call the _localAuth.getAvailableBiometrics() method in the app to retrieve the available biometrics.
4. It returns an empty list if the Face ID permission is not enabled for the app.

Tested in latest version: local_auth app package 3.0.1

If Face ID is already registered on the device but the permission is disabled for the app, getAvailableBiometrics() returns an empty list. In this case, it should return a non-empty result because Face ID is set up on the device. If Face ID permission is disabled for the app, how can I detect that it is disabled and prompt the user to enable it in the app settings?
How can I identify whether the permission is disabled specifically for the app?
Need urgent help on this.

Expected results

GetAvailableBiometrics() should return a non-empty list if Face ID is registered on the device, even when Face ID permission is not enabled for the app.
If Face ID permission is not enabled for the app, it should still return a non-empty list, and there should be an additional property in the local_auth API to check whether the permission is enabled or not.

Actual results

getAvailableBiometrics() returns an empty list if Face ID is registered on the device but the permission is disabled for the app.
If Face ID is not registered on the device, getAvailableBiometrics() also returns an empty list.

Code sample

Code sample
 Future<bool> isBiometricAvailable() async {
      try {
        final List<BiometricType> available = await _localAuth
            .getAvailableBiometrics();
        if (available.isNotEmpty) {
          return true;
        }
      } catch (_) {
        // ignore and fall back to other checks
      }
       return false;  
  }

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
[Paste your output here]

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: proposalA detailed proposal for a change to Flutterp: local_authPlugin for local authentificationpackageflutter/packages repository. See also p: labels.platform-iosiOS applications specificallyteam-ecosystemOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions