react-native-sensitive-info: Android: Error: Fingerprint operation canceled, iOS no response
-
I keep getting this
Error: Fingerprint operation canceled.
. It happens on theSInfo.setItem
because I do seestart
getting logged. I kinda just followed what it says on the docs. I can’t see why it doesn’t work. This only happens on Android. -
On iOS I see the biometrics prompt, but I get nothing from
SInfo.getItem
useEffect(() => {
async function testingLocalAuthentication() {
try {
console.log('start');
const setData = await SInfo.setItem('key1', 'secretStuff', {
sharedPreferencesName: 'mySharedPrefs',
keychainService: 'myKeychain',
touchID: true, //add this key
kSecAccessControl: 'kSecAccessControlBiometryAny',
});
console.log('------------setData: ', setData);
const response = await SInfo.getItem('key1', {
touchID: true,
showModal: true, //required (Android) - Will prompt user's fingerprint on Android
strings: {
// optional (Android) - You can personalize your prompt
description: 'Custom Title ',
header: 'Custom Description',
},
// required (iOS) - A fallback string for iOS
kSecUseOperationPrompt: 'We need your permission to retrieve encrypted data',
});
console.log('------------response: ', response);
} catch (error) {
console.log(error);
}
}
testingLocalAuthentication();
});
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 15 (5 by maintainers)
Using the same useEffect you provided
iOS (Tested on Iphone 11 emulator)
Probably a bug, using your sample code the data couldn’t be retrieved. It always return “undefined”. However, I was able to accomplish that removing the
touchId: true
fromgetItem
. However, this is not right.Created a dedicated issue here #233