ioannisa
07/11/2026, 6:39 PM// Device supports biometrics?
KSafeBiometrics.biometricsAvailableDirect(allowDeviceCredentialFallback = true) { available ->
// if biometrics available on device
if (available) {
// Request biometric approval with 60second cooldown (don't request again for 60 seconds)
KSafeBiometrics.verifyBiometricDirect(
reason = "Confirm payment",
authorizationDuration = BiometricAuthorizationDuration(60_000L)
) { success ->
// If success is true -> approved biometrics! Complete the payment
if (success) completePayment()
}
} else {
println("DEBUG: biometrics not available")
}
}
Also new: biometricsAvailable() tells you up front whether a real prompt exists on this device, so you can route to your own fallback flow. Strict biometrics-only mode and zero DI setup included.
It's a standalone artifact: you can gate any action with it, even without using KSafe storage!
📦 implementation("eu.anifantakis:ksafe-biometrics:2.2.1")
⭐ github.com/ioannisa/KSafe