'Face ID is not available in Expo Go

Trying to use FaceId with Expo. And documentation is below:

https://docs.expo.dev/versions/latest/sdk/local-authentication/

It looks like compatible with managed applications. But when I try It with my project, It returns error "Face ID is not available in Expo Go. You can use it in a standalone Expo app by providing NSFaceIDUsageDescription."

I'm using expo start to work test application on my phone. (Coudl that be about that?)

And here's my code:

import * as LocalAuthentication from 'expo-local-authentication';

const onFaceId = async () => {
try {
  // Checking if device is compatible
  const isCompatible = await LocalAuthentication.hasHardwareAsync();
  
  if (!isCompatible) {
    alert('Your device isn\'t compatible.')
  }

  // Checking if device has biometrics records
  const isEnrolled = await LocalAuthentication.isEnrolledAsync();
  
  if (!isEnrolled) {
    alert('No Faces / Fingers found.')
  }

  // Authenticate user
  await LocalAuthentication.authenticateAsync();

  console.log(LocalAuthentication)

  alert('Authenticated', 'Welcome back !')
} catch (error) {
  alert('An error as occured', error?.message);
}

};

Isn't that possible to use FaceID with Expo managed apps?



Solution 1:[1]

this can be a bit confusing. Basically, the expo go app is what's open when you use the expo start command. It's where you are basically running your app within the expo Go app. Based on the message, you need to create a standalone app (https://docs.expo.dev/build/setup/), and from there face ID can work when you run it on that instead of within the expo go app.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Cbirk