react-nativefingerprintexpotouch-idface-id

How to check if a user device is using fingerprint/face as unlock method. [ReactNative] [Expo]


I'm using ReactNative based on Expo Toolkit to develop a App and I want know how I can check if the user is using the fingerprint (TouchID on iPhone) or face detection (FaceID on iPhone X>) to unlock the device.

I already know how to check if device has the required hardware using Expo SDK, as follow:

let hasFPSupport = await Expo.Fingerprint.hasHardwareAsync();

But I need check if the user choose the fingerprint/face as unlock method on your device, instead pattern or pin.

Thanks


Solution

  • We can check if device has scanned fingerprints:

    await Expo.Fingerprint.isEnrolledAsync()
    

    So, this can be used to reach the objective as follow:

    let hasFPSupport = await Expo.Fingerprint.hasHardwareAsync() && await Expo.Fingerprint.isEnrolledAsync();