我正在尝试使用指纹和 Pincode 来实现生物识别,指纹工作正常,但是当我尝试使用 pin 码时,会出现带有 pin 码的屏幕,但如果我调用 pin 码检查,则不会调用回调没有指纹,只调用 onAuthenticationSucceeded,onAuthenticationError 和 onAuthenticationFailed 不,如果我在指纹后调用 pincode 检查,根本没有调用任何回调,我绑定对两者使用一个 BiometricPrompt 并为每个单独使用,但情况相同,可能会出现什么问题?
val promptInfo = BiometricPrompt.PromptInfo.Builder()
.setTitle("Authenticate")
.setSubtitle("Use PIN to authenticate")
.setAllowedAuthenticators(BiometricManager.Authenticators.DEVICE_CREDENTIAL)
.build()
val biometricPrompt = BiometricPrompt(this@SplashActivity, object : BiometricPrompt.AuthenticationCallback() {
override fun onAuthenticationSucceeded(result: BiometricPrompt.AuthenticationResult) {
// Authentication succeeded, handle the result here
Toast.makeText(this@SplashActivity, "AUTH", Toast.LENGTH_SHORT)
.show()
}
override fun onAuthenticationError(errorCode: Int, errString: CharSequence) {
// Authentication error, handle the error here
Toast.makeText(this@SplashActivity, "ERR", Toast.LENGTH_SHORT)
.show()
}
override fun onAuthenticationFailed() {
// Authentication failed, handle the failure here
Toast.makeText(this@SplashActivity, "FAIL", Toast.LENGTH_SHORT)
.show()
}
})
biometricPrompt.authenticate(promptInfo)
None
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)