capacitor-native-biometric icon indicating copy to clipboard operation
capacitor-native-biometric copied to clipboard

feat: reinstate the BiometricType in isAvailable response

Open prajapatijay95 opened this issue 2 months ago • 3 comments

Feature Request

Description

Please reinstate the BiometricType feature. This allows us to determine the type of biometric being used with the same plugin, enabling us to display the appropriate icon or text to users.

Platform(s)

Android, iOS

Preferred Solution

It would be beneficial to include BiometricType and AuthenticationStrength in the response for the isAvailable method.

Alternatives

Add a new method to return the BiometricType.

Additional Context

prajapatijay95 avatar Nov 11 '25 03:11 prajapatijay95

Hi, I would love to be able to have BiometricType. Unfortunately, I strongly believe it's impossible to implement correctly. The old implementation was full of small bugs that made BiometricType completely unreliable on Android.

Here is a SO post talking about this: https://stackoverflow.com/questions/50968732/determine-if-biometric-hardware-is-present-and-the-user-has-enrolled-biometrics

The problems I had were the following:

  • Some devices consider face authentication as a strong factor while others (an old samsung) considers it to be a week form of authentications, which our plugin did not account for
  • Knowing that strong authentication is available (a strong factor is available) and knowing that the device has multiple hardware does not mean the device has enrolled a certain type of biometrics. For instance, imagine you have an iris scanner and a fingerprint scanner. If you have enrolled only one of these, the plugin would say you have multiple factors available, which was not true

There is no API in the android ecosystem that would reliably help us reliably achieve the previous isAvailable functionality.

WcaleNieWolny avatar Nov 11 '25 12:11 WcaleNieWolny

@WcaleNieWolny Can it at least be added on iOS part? There are still some devices with just TouchID and it will not be a safe assumption to use FaceID all the time.

prajapatijay95 avatar Nov 12 '25 00:11 prajapatijay95

Sure, it is possible. I'll make a note in my TODO list and when I have a bit of time, I will come back to this.

WcaleNieWolny avatar Nov 12 '25 04:11 WcaleNieWolny

I have the same problem. The readme file currently shows a wrong example.

But: Thank you for the good package, helped a lot in our project!

florian-adelt avatar Dec 04 '25 14:12 florian-adelt