diff --git a/app/build.gradle b/app/build.gradle
index 03d67f5..20252d1 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -146,4 +146,6 @@ dependencies {
implementation "com.valentinilk.shimmer:compose-shimmer:1.2.0"
+
+ implementation "androidx.biometric:biometric-ktx:1.2.0-alpha05"
}
\ No newline at end of file
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 3d59dbe..fdab32f 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -24,6 +24,8 @@
+
+
= Build.VERSION_CODES.R) {
+ val executor = ContextCompat.getMainExecutor(context)
+ val promptInfo = BiometricPrompt.Builder(context)
+ .setTitle("Biometric login for my app")
+ .setSubtitle("Log in using your biometric credential")
+ .setAllowedAuthenticators(
+ BIOMETRIC_STRONG or DEVICE_CREDENTIAL
+ )
+ .build()
+
+ // Prompt appears when user clicks "Log in".
+ // Consider integrating with the keystore to unlock cryptographic operations,
+ // if needed by your app.
+ promptInfo.authenticate(
+ CancellationSignal(),
+ executor,
+ object : BiometricPrompt.AuthenticationCallback() {
+ override fun onAuthenticationError(errorCode: Int, errString: CharSequence) {
+ super.onAuthenticationError(errorCode, errString)
+ }
+
+ override fun onAuthenticationSucceeded(result: BiometricPrompt.AuthenticationResult) {
+ super.onAuthenticationSucceeded(result)
+ }
+
+ override fun onAuthenticationFailed() {
+ super.onAuthenticationFailed()
+ }
+ })
+ }
+ }
+
LaunchedEffect(settings.theme) {
if (!SUPPORTS_DARK_MODE_NATIVELY) {
val currentValue = AppCompatDelegate.getDefaultNightMode()