1.0.1 • Published 4 years ago

react-native-local-authenticate v1.0.1

Weekly downloads
61
License
Apache License
Repository
github
Last release
4 years ago
ReactNative: Local Authenticate [FaceID/TouchID] (Android/iOS)

If this project has helped you out, please support us with a star 🌟

This library is the replica of expo-local-authentication source. It can be used as standalone library in case someone does not wants to configure expo environment.

📖 Getting started

$ npm install react-native-local-authenticate --save

RN60 >= RNLA V1 >

RN60 above please use react-native-local-authenticate V1 and above

  • iOS

iOS Prerequisite: Please make sure CocoaPods is installed on your system

- Add the following to your `Podfile` -> `ios/Podfile` and run pod update:
  use_native_modules!

  pod 'RNLocalAuthenticate', :path => '../node_modules/react-native-local-authenticate/ios'
  • Android

Please add below permission to your app AndroidManifest

    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
    <uses-permission android:name="android.permission.USE_BIOMETRIC"/>

RN60 < RNLA V1 <

RN60 below please use react-native-local-authenticate V.0.*

$ react-native link react-native-local-authenticate

  • Android

    • Please add below script in your build.gradle
buildscript {
    repositories {
        jcenter()
        maven { url "https://maven.google.com" }
        ...
    }
}

allprojects {
    repositories {
        mavenLocal()
        jcenter()
        maven { url "https://maven.google.com" }
        ...
    }
}

Note

  • Android SDK 27 > is supported

💬 Usage

import { RNLocalAuthenticate } from 'react-native-local-authenticate'

RNLocalAuthenticate.HasHardware().then((hasHardware) => {
})

RNLocalAuthenticate.IsEnrolled().then((isEnrolled) => {
})

RNLocalAuthenticate.SupportedAuthenticationTypes().then((isEnrolled) => {
})

RNLocalAuthenticate.Authenticate('reason').then((isEnrolled) => {
})

💡 Props

  • General(iOS & Android)
PropTypeDefaultNote
HasHardware:PromiseboolUsed to check for hardware capability
IsEnrolled:PromiseboolUsed to check enrolled for FaceID/TouchID
AuthenticateboolUsed to authenticate user using FaceId/TouchID
  • Android
PropTypeDefaultNote
CancelAuthenticate | true | Used to cancel ongoing authentication
  • iOS
PropTypeDefaultNote
SupportedAuthenticationTypesarrayUsed to check supported authentication types

✨ Credits

🤔 How to contribute

Have an idea? Found a bug? Please raise to ISSUES. Contributions are welcome and are greatly appreciated! Every little bit helps, and credit will always be given.

💫 Where is this library used?

If you are using this library in one of your projects, add it in this list below. ✨

📜 License

This library is provided under the Apache 2 License.

RNAppTour @ prscX

💖 Support my projects

I open-source almost everything I can, and I try to reply everyone needing help using these projects. Obviously, this takes time. You can integrate and use these projects in your applications for free! You can even change the source code and redistribute (even resell it).

However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it:

  • Starring and sharing the projects you like 🚀
  • If you're feeling especially charitable, please follow prscX on GitHub.

    Thanks! ❤️ prscX.github.io </ Pranav >

1.0.1

4 years ago

1.0.0

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago