naoufal / react-native-touch-id

React Native authentication with the native Touch ID popup.
https://www.npmjs.com/package/react-native-touch-id
1.48k stars 477 forks source link

Is this supported on Expo? #51

Closed appjitsu closed 7 years ago

appjitsu commented 7 years ago

... or does the app have to deployed to the device from xcode?

My code always fails.

"Touch ID is not supported on your device."

_loginIDHandler() {
    TouchID.isSupported()
    .then(supported => {
      TouchID.authenticate('Easily login into OTCMe.')
      .then(success => {
        AlertIOS.alert('Authenticated Successfully');
      })
      .catch(error => {
        AlertIOS.alert('Authentication Failed');
      });
    })
    .catch(error => {
      AlertIOS.alert('Touch ID is not supported on your device.');
    });
  }
naoufal commented 7 years ago

I can't speak for Expo, but last I checked the iPhone simulator didn't support TouchID.

So you have to test on a physical device.

zibs commented 7 years ago

@appjitsu Expo supports this out of the box with their own implementation. See the docs here: https://docs.expo.io/versions/latest/sdk/fingerprint.html

@naoufal XCode/iPhone simulator now supports Touch ID! You enable it from Simulator -> Hardware -> Toggle Enrolled State or something, and then you can either fake a successful touch or a failed touch.