-
Use FingerprintHandler & BiometricUtils class for biometric authentication
-
Add below permissions in your AndroidMenifest.xml
<uses-permission android:name="android.permission.USE_BIOMETRIC" />
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
-
Use this code for start authentication
val handler = FingerprintHandler(this) handler.initTouchAuth { code, message -> if (handler.isSuccess(code)) { Toast.makeText(this, message, Toast.LENGTH_LONG).show() /* Open next screen from here */ finish() } else { errorText.setTextColor(Color.RED) errorText.text = message } }