USE_FINGERPRINT is deprecated in API level 28

前端 未结 3 1568
感情败类
感情败类 2021-02-03 18:44

Constant USE_FINGERPRINT was deprecated in API level 28 and we should use more generic USE_BIOMETRIC which has been added in same API level.

I

3条回答
  •  情深已故
    2021-02-03 19:15

    biometrics API provides BiometricConstants for error handling

    override fun onAuthenticationError(errorCode: Int, errString: CharSequence) {
        super.onAuthenticationError(errorCode, errString)
    
        //The device does not have a biometric sensor.
        if (errorCode == BiometricPrompt.ERROR_HW_NOT_PRESENT){
          //Do something
        }
    }
    

提交回复
热议问题