I'm trying to implement Face ID in my React Native project.
...
import * as LocalAuthentication from 'expo-local-authentication';
...
componentDidMount = async () => {
const hasAuth = await LocalAuthentication.hasHardwareAsync();
if(hasAuth)
LocalAuthentication.authenticateAsync();
}
...
When I run it in expo expo-start
using my phone, it opens the iPhone page where ask for passcode (not faceID). After entering the passcode it returns the warning message below and the Face ID does not work.
FaceID is not available in Expo Client. You can use it in a standalone Expo app by providing `NSFaceIDUsageDescription`
I also added the NSFaceIDUsageDescription to my app.json.
"infoPlist": {
"NSFaceIDUsageDescription": "This app will optionally use Face ID or Touch ID to save login"
}
Expo Local Authentication FaceID doesnt work on expo client app, but you can test it building an archive IPA for IOS.
expo build:ios -t archive
. It will create a build for IOS and then you can test it.