Skip to content

[local_auth] canCheckBiometrics returns false when Face ID permission isn't granted #160083

Closed
flutter/packages
#8348
@MohsinIkram-Auxilium

Description

@MohsinIkram-Auxilium

Use case

I mistakenly disable the Face ID permission to my app. Now I'm unable to know how can i ask to the user you disable the permission. Basically I'm showing the Face Icon on these methods.

  Future<bool> isDeviceSupported() async {
    try {
      Debugger.log("isDeviceSupported ${await _auth.isDeviceSupported()}");
      return await _auth.isDeviceSupported();
    } catch (e) {
      Debugger.log("Error checking device support: $e");
      return false;
    }
  }

  Future<bool> canCheckBiometrics() async {
    try {
      Debugger.log("canCheckBiometrics ${await _auth.canCheckBiometrics}");
      return await _auth.canCheckBiometrics;
    } catch (e) {
      Debugger.log("Error checking biometrics: $e");
      return false;
    }
  }

isDeviceSupported this is gives me true but canCheckBiometrics this always give me false when I'm not enable the Face ID. So i just need to know how can i check if the user disbale the Face ID. so I asked him to go to setting and enable it.

Need urgent help on this.
Thanks

Proposal

  Future<bool> isDeviceSupported() async {
   try {
     Debugger.log("isDeviceSupported ${await _auth.isDeviceSupported()}");
     return await _auth.isDeviceSupported();
   } catch (e) {
     Debugger.log("Error checking device support: $e");
     return false;
   }
 }

 Future<bool> canCheckBiometrics() async {
   try {
     Debugger.log("canCheckBiometrics ${await _auth.canCheckBiometrics}");
     return await _auth.canCheckBiometrics;
   } catch (e) {
     Debugger.log("Error checking biometrics: $e");
     return false;
   }
 }

Metadata

Metadata

Assignees

No one assigned

    Labels

    p: local_authPlugin for local authentificationpackageflutter/packages repository. See also p: labels.platform-iosiOS applications specificallyr: fixedIssue is closed as already fixed in a newer versionteam-iosOwned by iOS platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions