You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[local_auth] canCheckBiometrics returns false when Face ID permission isn't granted #160083
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.
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.
Hi @MohsinIkram-Auxilium, Thanks for filing the issue. I believe you should use getAvailableBiometrics to get the list of enrolled biometrics on the device.
@maheshj01 when user not enable the Face ID then the getAvailableBiometrics list always empty.
I have added different checks like
1- Is Device supported the Biometrics
2- Is getAvailableBiometrics are available or not
I need to add check at the very top of these like User enabled the Face ID permission or not, if not then simply i would show error message to user please go to setting and enable Face ID. Thats it.
It would be better if package developers team can add Face ID check permission. So it would be for us to show appropriate error message.
What do you think?
when user not enable the Face ID then the getAvailableBiometrics list always empty.
getAvailableBiometrics is supposed to return the enrolled biometrics on device, meaning list of biometrics user has setup on their device. The result is empty here is because of this issue #117309
I need to add check at the very top of these like User enabled the Face ID permission or not, if not then simply i would show error message to user please go to setting and enable Face ID. Thats it.
I believe you should be able to detect this once the referred issue has been solved. But I agree there should be a way to detect which biometrics are enabled something like getEnabledBiometrics
getAvailableBiometrics gives a list of enrolled biometrics but does not guarantee that the biometrics is enabled by user on device.
Labeling this issue as a proposal to provide an api to determine if a particular biometric is enrolled and enabled to authenticate.
Sorry I think you didn't get my point. I have a simple question. Let me clarify again.
Lets suppose I have enrolled face and finger auth in the mobile.
And when very first time open the Flutter IOS app, It asked me to enable Face ID like as IOS ask for Photo and location.
When you enable the photo library then i allow us to choose images from the photo library.
So now I disable the FaceID and trying to call again auth method. Now there is no way to check user disable the FaceID.
So need to add check here, the user disbale the FaceID, i will show the error message "Go to settings and enable the FaceID".
Thats it.
I just need to check either user enable the Face ID or not.
So now I disable the FaceID and trying to call again auth method. Now there is no way to check user disable the FaceID.
So need to add check here, the user disbale the FaceID, i will show the error message "Go to settings and enable the FaceID".
@MohsinIkram-Auxilium, I have marked this issue as a proposal to have some way to know which biometric is enabled/disabled. If there are any further updates on this issue you will see them here.
changed the title [-][local_auth] Need to know user grant the Face ID permission or not[/-][+][local_auth] `canCheckBiometrics` returns false when Face ID permission isn't granted[/+]on Dec 22, 2024
Yeah @stuartmorgan. You are right.
There should be error messages while if any of these methods not working. So user can see appropriate message.
Although all these functions return only Boolean value which should be changed with any error message in case of false.
I enabled FaceID in my phone settings. Then I ran the example app. When I selected "Authenticate" in the app I denied permission. Then I checked biometrics, and it returned -6 so LAErrorBiometryNotAvailable. Which is annoying because I believe that would be the same error code on a device that doesn't have biometry hardware available.
However, a better way to detect the permission denied case might be if LAErrorBiometryNotAvailable and context.biometryType isn't LABiometryTypeNone. In my testing above it returned LABiometryTypeTouchID.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
maheshj01 commentedon Dec 12, 2024
Hi @MohsinIkram-Auxilium, Thanks for filing the issue. I believe you should use
getAvailableBiometricsto get the list of enrolled biometrics on the device.source: https://pub.dev/packages/local_auth/example
maheshj01 commentedon Dec 12, 2024
Incase that doesn't work this could be the reason #117309
MohsinIkram-Auxilium commentedon Dec 12, 2024
@maheshj01 when user not enable the Face ID then the getAvailableBiometrics list always empty.
I have added different checks like
1- Is Device supported the Biometrics
2- Is getAvailableBiometrics are available or not
I need to add check at the very top of these like User enabled the Face ID permission or not, if not then simply i would show error message to user please go to setting and enable Face ID. Thats it.
It would be better if package developers team can add Face ID check permission. So it would be for us to show appropriate error message.
What do you think?
maheshj01 commentedon Dec 12, 2024
@MohsinIkram-Auxilium
getAvailableBiometricsis supposed to return the enrolled biometrics on device, meaning list of biometrics user has setup on their device. The result is empty here is because of this issue #117309I believe you should be able to detect this once the referred issue has been solved. But I agree there should be a way to detect which biometrics are enabled something like
getEnabledBiometricsgetAvailableBiometrics gives a list of enrolled biometrics but does not guarantee that the biometrics is enabled by user on device.
Labeling this issue as a proposal to provide an api to determine if a particular biometric is enrolled and enabled to authenticate.
MohsinIkram-Auxilium commentedon Dec 13, 2024
Sorry I think you didn't get my point. I have a simple question. Let me clarify again.
Lets suppose I have enrolled face and finger auth in the mobile.
And when very first time open the Flutter IOS app, It asked me to enable Face ID like as IOS ask for Photo and location.
When you enable the photo library then i allow us to choose images from the photo library.
So now I disable the FaceID and trying to call again auth method. Now there is no way to check user disable the FaceID.
So need to add check here, the user disbale the FaceID, i will show the error message "Go to settings and enable the FaceID".
Thats it.
I just need to check either user enable the Face ID or not.
MohsinIkram-Auxilium commentedon Dec 16, 2024
@maheshj01 any update on my feedback please?
maheshj01 commentedon Dec 16, 2024
@MohsinIkram-Auxilium, I have marked this issue as a proposal to have some way to know which biometric is enabled/disabled. If there are any further updates on this issue you will see them here.
6 remaining items
[-][local_auth] Need to know user grant the Face ID permission or not[/-][+][local_auth] `canCheckBiometrics` returns false when Face ID permission isn't granted[/+]MohsinIkram-Auxilium commentedon Dec 23, 2024
Yeah @stuartmorgan. You are right.
There should be error messages while if any of these methods not working. So user can see appropriate message.
Although all these functions return only Boolean value which should be changed with any error message in case of false.
jmagman commentedon Dec 26, 2024
I enabled FaceID in my phone settings. Then I ran the example app. When I selected "Authenticate" in the app I denied permission. Then I checked biometrics, and it returned -6 so
LAErrorBiometryNotAvailable. Which is annoying because I believe that would be the same error code on a device that doesn't have biometry hardware available.However, a better way to detect the permission denied case might be if
LAErrorBiometryNotAvailableandcontext.biometryTypeisn'tLABiometryTypeNone. In my testing above it returnedLABiometryTypeTouchID.[local_auth_darwin] Handle when FaceID hardware is available but perm…
github-actions commentedon Jan 31, 2025
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.[local_auth_darwin] Handle when FaceID hardware is available but perm…
[local_auth_darwin] Handle when FaceID hardware is available but perm…
[local_auth_darwin] Handle when FaceID hardware is available but perm…
[local_auth_darwin] Handle when FaceID hardware is available but perm…