Skip to content

Instantly share code, notes, and snippets.

@husaynhakeem
Created September 10, 2020 05:20
Show Gist options
  • Save husaynhakeem/6ed1b77a7dc96eb3b0a48810ee9d02f9 to your computer and use it in GitHub Desktop.
Save husaynhakeem/6ed1b77a7dc96eb3b0a48810ee9d02f9 to your computer and use it in GitHub Desktop.
val biometricManager = BiometricManager.from(context)
val authenticationTypes = BIOMETRIC_WEAK or DEVICE_CREDENTIAL
val canAuthenticate = biometricManager.canAuthenticate(authenticationTypes)
if (canAuthenticate == BIOMETRIC_SUCCESS) {
// The device supports weak biometric authentication or non-biometric authentication, e.g. PIN
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment