After I did not get any feedback and research of almost 24 hours I get a solution for my problems after research on different resources.
So, androidx.core.hardware.fingerprint.FingerprintManagerCompat
is deprecated in newly available API 28 and 29 and instead of this, there is another class available that is androidx.biometric.BiometricPrompt
.
This new BiometricPrompt is more efficient and helping for displaying a standard dialog to guide the user through the authentication process, performing the authentication and reporting the results to the app. The BiometricPrompt class has a static builder class PromptInfo
that can be used to configure and create BiometricPrompt instances.
So, the solution is for creating an instance of BioMetricPrompt as per newly available API is:
val biometricPrompt = BiometricPrompt.PromptInfo.Builder()
.setTitle("Biometric Demo")
.setSubtitle("Authentication is required to continue")
.setDescription("This app uses biometric authentication to protect your data.")
.setNegativeButtonText("Cancel")
.build()
BiometricPrompt(this.activity!!, getMainExecutor(this.activity), getAuthenticationCallback()).authenticate(biometricPrompt)