0

I am implementing BiometricPrompt in my app, everything is fine except that I am not able to change some failure messages. BiometricPrompt class provide methods to change the title, subtitle, description and negative button. Check code below:

    promptInfo = new BiometricPrompt.PromptInfo.Builder()
                .setTitle(mContext.getString(R.string.verifiy_your_identity))
                .setSubtitle(mContext.getString(R.string.place_your_finger))
   .setDescription(mContext.getString(R.string.to_verify_your_identity))
                .setNegativeButtonText(mContext.getString(R.string.cancel))
                .build();

if the fingerprint is wrong I am getting a message saying: No match. if I remove my finger fast, I get: Keep your finger on the sensor a little bit longer

how can I change these messages?

Image Preview

4

1 回答 1

1

No. You cannot customize default errors provided by BiometricPrompt. If you want to show your own customised errors, better option would be to look for error codes provided by BiometricPrompt. Then you can use switch cases or if-else and based on error code you can show your custom error message.

于 2019-06-17T11:34:42.917 回答