jarden-digital/react-native-pincode

How to use launchTouchID

Opened this issue · 4 comments

Hi,

I am probably missing something, but I can't find a way to use the option launchTouchID.
What I want to achieve is to force touchId when the user press a button.

I tried something like the following:

const launchBiometrics = () => {
        console.log('touchID launched');
    }

return (
        <View style={sharedStyles.container}>
            <Loader size='small' />
            <PINCode
                launchTouchID={launchBiometrics}
            />
            <DefaultValidateButton
                onPressFn={() => {
                    launchBiometrics();
                }}
            />
        </View>
    );
}

Could you please explain me how I should proceed? I would gladly appreciate any help.

Thanks a lot

Hi!

Sorry for the delay.
From what I can see, it's not even passed as a prop in index anymore for some reason 🤦
I'll try to work on this asap but if you can, just open a PR for it 😄

Cheers

Hi!

Sorry for the delay.
From what I can see, it's not even passed as a prop in index anymore for some reason 🤦
I'll try to work on this asap but if you can, just open a PR for it 😄

Cheers

Yes, please do it.

It is necessary to somehow activate the launchTouchID again if the user clicks cancel for the first time.

Thank you!

@EmilMakaev you can use following example:

...
  const touchIdButton = useCallback(
    (launchTouchID: () => void) => {
      return (
        <Button
          type="clear"
          icon={
            <Icon
              type="ionicon"
              name="finger-print-outline"
            />
          }
          onPress={launchTouchID}
        />
      );
    },
    [],
  );
...
return <PINCode bottomLeftComponent={touchIdButton} />

@EmilMakaev you can use following example:

...
  const touchIdButton = useCallback(
    (launchTouchID: () => void) => {
      return (
        <Button
          type="clear"
          icon={
            <Icon
              type="ionicon"
              name="finger-print-outline"
            />
          }
          onPress={launchTouchID}
        />
      );
    },
    [],
  );
...
return <PINCode bottomLeftComponent={touchIdButton} />

Thank you very much for your help!