0

I have built an android app which successfully uses fingerprint authentication API in AndroidStudio. I need to build the same thing but using React Native for android. How to go about it? is fingerprint authentication API supported in React? can i re-use my Java code?

NathanK
  • 9
  • 2
  • 5

2 Answers2

2

You can use React Native Touch Id plugin for handling Touch event in React native. But Unfortunately, Android implementation is not completed yet.

So, You have to write the bridge. Android code can be used in React Native. If you want to learn more about how to bridge the Javascript Code with Native JAVA, Check https://facebook.github.io/react-native/docs/native-modules-android.html

Sriraman
  • 7,658
  • 4
  • 40
  • 60
  • Can you explain more please? this covers the easy parts mostly, which are great, but for fingerprint authentication i had to use fingerprint permission, create a cipher object, generate secure key, and a handler class for authentication, how can all be done in JavaScript? – NathanK Jun 29 '16 at 20:13
  • You can done everything in JAVA itself. After processing everything you can just send the callback to the React Native Layer. For sending callbacks to the Javascript layer, React Native providing `DeviceEventEmitter` and `LifecycleEventListener`. – Sriraman Jun 30 '16 at 05:16
0

Fingerprint authentication API is supported in ReactNative. You can use existing native module or create your own

For the head start, you can fork my project and start building on top of it.

https://github.com/hiteshsahu/FingerPrint-Authentication-With-React-Native-Android

I created this native module keeping data security as top priority and it is backward compatible with older versions of Android (API<23)

enter image description here

Features

  • Uses FingerprintManagerCompat to Supports Older Version of Android(API<23) Native Module to use fingerprint Sensor

  • Error Handling in the case of invalid Finger Prints, Unregistered FingerPrint, Lock is not enabled and not supporting Hardware.

  • After exceeding max finger print attempts, the plugin disables biometric authentication feature.
  • Disables biometric authentication can be enabled from Home Screen after successful login
  • User Credentials are Encrypted with AES algorithm and stored in file system while key is stored in Android Keystore
  • Check for Rooted device and flush stored credentials
Hitesh Sahu
  • 41,955
  • 17
  • 205
  • 154