Biometrics

How to use it?

  1. Show screen to request permissions to configure touch ID or face ID:

  • Import AUTH_BIOMETRICS_SCREENS constant where you have the Stack.Navigator you want to display the biometrics screen:

import {AUTH_BIOMETRICS_SCREENS} from 'LinkerStudio/modules/authentication/common/constants';
  • Add this code block to the Stack.Navigator you want to display the biometrics screen:

<Stack.Group>
   {AUTH_BIOMETRICS_SCREENS.map(screen => (
    <Stack.Screen
      key={screen.name}
      name={screen.name}
      component={screen.component}
    />
 ))}
</Stack.Group>
  • Import the AuthBiometricsStackParams type where you have the stack params list type of the Stack.Navigator you want to display the biometrics screens. It is usually the types.ts file:

import {AuthBiometricsStackParams} from 'LinkerStudio/modules/authentication/common/navigation/types';

Add the AuthBiometricsStackParams type to your stack params list type, so your stack navigator can recognize the biometrics screens.

Take the following as an example:

export type RootStackParamsList = {MY SCREENS TYPES} & AuthBiometricsStackParams;

2. Add buttons to log in with biometrics:

  • Import BiometricsButtons component where you want to use biometric login:

import {BiometricsButtons} from 'LinkerStudio/modules/authentication/Biometrics/components/molecules';
  • Add this code block to show login buttons with biometrics:

<BiometricsButtons />

Last updated