react-native-keychain
react-native-keychain copied to clipboard
iOS not prompting for FaceID
I'm trying to store a set of credentials in the iOS keychain to be then retrieved authenticating with biometrics (FaceID in this case, since I'm testing on an iPhone 11 simulator).
Here's the code I'm using:
console.log(await getSupportedBiometryType());
await resetGenericPassword();
await setGenericPassword('username', 'password', {
accessControl: ACCESS_CONTROL.BIOMETRY_ANY,
});
try {
// Retrieve the credentials
const credentials = await getGenericPassword();
if (credentials) {
console.log(credentials);
} else {
console.log('No credentials stored');
}
} catch (error) {
console.log("Keychain couldn't be accessed!", error);
}
Which logs "FaceID" confirming it detects the functionality and also the credentials (so it's retrieving the credentials from the keychain without asking for biometric auth).
I've the NSFaceIDUsageDescription
key defined in my Info.plist and the FaceID > Enrolled option enabled in my simulator.
I'm sure I'm missing something obvious since I don't see anyone else reporting this and it's an integral part of the functionality of the library and I'd really appreciate if someone could help me out.
Thank you in advance
Having the same issue. Done some digging and found this:
https://github.com/oblador/react-native-keychain/issues/132#issuecomment-393658191
Really hope this isn't still the case...
Having the same issue. Done some digging and found this:
Really hope this isn't still the case...
yes this library doesnt work on the simulator
You need to add NSFaceIDUsageDescription
to the info.plist, or apple will force quit the app when requesting it.
https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html#//apple_ref/doc/uid/TP40009251-SW75
yo is this still an issue? my function is working correctly logging "bio auth passed" but I'm not seeing it work in the simulator? was working fine for expo local authentication...
@RichMatthews You can't test this using a simulator. Only real devices.
Works fine as I've just pushed a release out to production on an app I develop and everything works fine.
I have the same issue on a real iPhone XS Max. Setting/getting credentials goes successfully without prompting Face ID
Any updates on this? Still facing the same issue
Also having the same issue even after building and testing in TestFlight. I can get and set credentials without any sign of Face or Touch ID.
@RichMatthews You can't test this using a simulator. Only real devices.
Works fine as I've just pushed a release out to production on an app I develop and everything works fine.
So is this really true that I can't test this in Simulator? I can't find it anywhere in the docs and when I was using expo-local-authentication
, I had FaceID prompts even in Simulator. What is the reason it's not working with this library?
(I have set the NSFaceIDUsageDescription
key in Info.plist)