Android - BiometricPrompt detect whether is a face id or touch id

1.3k Views Asked by At

In my Android app, I use this code to ask user for biometrical authentication:

val title = "..."
val subtitle = "..."

BiometricPrompt.PromptInfo.Builder()
            .setTitle(title)
            .setSubtitle(subtitle)
            .build()

My case is, that I want to customise the title and subtitle in case of touchID usage or faceID.

Is there any way to detect which biometrical method is going to be shown to the user?

I found out that we can check if a feature is available or not with:

val hasFaceId = context.packageManager.hasSystemFeature(PackageManager.FEATURE_FACE)

But FEATURE_FACE is only available on Android API 29, and I need something that works even for older Android versions.

1

There are 1 best solutions below

1
On

As per latest Android Biometric docs, there are no such APIS which can solve your requirement.