Expo FingerPrint scanner on Android issue

#1

I am setting finger print scanner on expo it works fine with IOS devices but when i am working with android i tried two codes, One is working and another is not. Please help me in this.

Not working one.

class AndroidScanner extends Component {
    render(){
        return(
            <View>
                {Alert.alert('Place your finger to scan.')}
            </View>
        );
    }
}

Expo.Fingerprint.authenticateAsync(<AndroidScanner/>).then(fingerScannerResponse => {
                if (fingerScannerResponse.success) {
                    console.log('Finger Valid')
                }else {
                    console.log('Finger Invalid')
                }
            });

Working one

Expo.Fingerprint.authenticateAsync(Alert.alert('Place your finger to scan.')).then(fingerScannerResponse => {
                if (fingerScannerResponse.success) {
                    console.log('Finger Valid')
                }else {
                    console.log('Finger Invalid')
                }
            });

Please help me with this in API they have return you can add component but same thing in class is not working… Also inform me if i have made any mistake.

#2

hi @jayantchauhan, here is an example of using Fingerprint.authenticateAsync that will hopefully clear things up https://github.com/expo/native-component-list/blob/9600d0c86722f31012f462a9c9867a9e3b9464bc/screens/ExpoApisScreen.js#L1070-L1098

Sorry for the inconvenience, we will work to make the docs better!

#3

@quinlanj Thank you for your answer but it is working for IOS not on android. On android i require component to show finger print scanner for that i am preparing one component & passing it to authenticateAsync but it is not working.

#4

FYI, I’ve opened a feature request: https://expo.canny.io/feature-requests/p/fingerprint-screen-on-android

#5

Hello, Did you find a way to work on android? Thanks.

#6

Hello,
I’m managing to use this to scan the finger but I cannot seem to find a way to retry if the scanner doesn’t recognize the finger… I think I must be missing something. Is there any undocumented “retry” method? iOS handles this on its own, but android does not.

Thanks!

1 Like