EACUAMBA / screen_lock_based_on_routes

A simple project using local authentication and react-navigation to block a screen after a predefined time and ask the user for authentication, very common in financial apps.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Screen Lock Based on Routes

How to do it?

Install the React Navigation Native, a lib to help us do the native navigation in Android and IOS OS.

npm install @react-navigation/native

then install the Native Stack

npm install @react-navigation/native-stack

then install the expo-local-authentication

npx expo install expo-local-authentication

then you need to add some config in your app.json

{
  "expo": {
    "plugins": [
      [
        "expo-local-authentication",
        {
          "faceIDPermission": "Allow $(PRODUCT_NAME) to use Face ID."
        }
      ]
    ]
  }
}

and you are ready to start develop, but before run the app for the first time, we need to set up the directories structure we are going to use.

{project_root}/src/screens/ -> Save here the screens of your application.

About

A simple project using local authentication and react-navigation to block a screen after a predefined time and ask the user for authentication, very common in financial apps.


Languages

Language:TypeScript 96.6%Language:JavaScript 3.4%