I am using this package to implement Biometric authentication on my react-native project. As i wanted to control the text on biometric prompt i upgrade from v5 to v6. But now after upgrading, on Android, its not prompting for authentication the second time once after successful authentication.
Expectation: It should propmt for authentication when ever we call getGenericPassword() method.
Hi @Raythode!
I had the same issue and solved it by adding the service config (for example com.example.appname) on both setGenericPassword() and getGenericPassword().
My code is like this:
await Keychain.setGenericPassword(email, passcode, {
service: 'com.example.appname',
accessControl: Keychain.ACCESS_CONTROL.BIOMETRY_CURRENT_SET,
accessible: Keychain.ACCESSIBLE.WHEN_PASSCODE_SET_THIS_DEVICE_ONLY,
})
so then:
const credentials = await Keychain.getGenericPassword({
service: 'com.example.appname',
authenticationPrompt: {
title: t('authenticationPromptTitle'),
subtitle: t('authenticationPromptSubtitle'),
description: authStore.hasFaceIdSupport
? t('authenticationPromptFace')
: t('authenticationPromptFingerprint'),
cancel: t('authenticationPromptCancel'),
},
})
Hope it helps.
thank you this works for me.
Most helpful comment
Hi @Raythode!
I had the same issue and solved it by adding the
serviceconfig (for example com.example.appname) on bothsetGenericPassword()andgetGenericPassword().My code is like this:
so then:
Hope it helps.