GithubHelp home page GithubHelp logo

hieuvp / react-native-fingerprint-scanner Goto Github PK

View Code? Open in Web Editor NEW
870.0 19.0 298.0 2.41 MB

Provide Fingerprint, Touch ID, and Face ID Scanner for React Native (Compatible with both Android and iOS)

Home Page: https://www.npmjs.com/package/react-native-fingerprint-scanner

Java 49.59% JavaScript 24.60% Objective-C 23.39% Ruby 2.42%
react-native react touch-id touchid fingerprint fingerprint-scanner touch authentication authenticate auth

react-native-fingerprint-scanner's Introduction

React Native Fingerprint Scanner

Looking for Maintainers

This project is no longer actively maintained by the previous maintainers. If you would like to propose a PR we can merge it though, it needs your effort to continue!


React Native Version Version NPM

React Native Fingerprint Scanner is a React Native library for authenticating users with Fingerprint (TouchID).

Table of Contents

iOS Version

The usage of the TouchID is based on a framework, named Local Authentication.

It provides a Default View that prompts the user to place a finger to the iPhone’s button for scanning.

Android Version

4.0.0 Prefers the new native Android BiometricPrompt lib on any Android >= v23 (M) 4.0.0 also DEPRECATES support for the legacy library that provides support for Samsung & MeiZu phones

3.0.2 and below: Using an expandable Android Fingerprint API library, which combines Samsung and MeiZu's official Fingerprint API.

Samsung and MeiZu's Fingerprint SDK supports most devices which system versions less than Android 6.0.

Installation

$ npm install react-native-fingerprint-scanner --save

or

$ yarn add react-native-fingerprint-scanner

Automatic Configuration

For RN >= 0.60

$ cd ios && pod install

For RN < 0.60, use react-native link to add the library to your project:

$ react-native link react-native-fingerprint-scanner

Manual Configuration

iOS

  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesreact-native-fingerprint-scanner and add ReactNativeFingerprintScanner.xcodeproj
  3. To add the library "libReactNativeFingerprintScanner.a" to your project in XCode:
    • In the project navigator, select your project.
    • Click on the "Build Phases" tab.
    • Under "Link Binary With Libraries", click the "+" button to add a new library.
    • Search for "libReactNativeFingerprintScanner.a" and select it.
    • Click "Add" to add the library to your project.
  4. Run your project (Cmd+R)

Android

  1. Open up android/app/src/main/java/[...]/MainApplication.java
  • Add import com.hieuvp.fingerprint.ReactNativeFingerprintScannerPackage; to the imports at the top of the file
  • Add new ReactNativeFingerprintScannerPackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':react-native-fingerprint-scanner'
    project(':react-native-fingerprint-scanner').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fingerprint-scanner/android')
    
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
    implementation project(':react-native-fingerprint-scanner')
    

App Permissions

Add the following permissions to their respective files:

Android

In your AndroidManifest.xml:

API level 28+ (Uses Android native BiometricPrompt) (Reference)

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

API level 23-28 (Uses Android native FingerprintCompat) Reference)

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

// DEPRECATED in 4.0.0 API level <23 (Uses device-specific native fingerprinting, if available - Samsung & MeiZu only) Reference)

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

iOS

In your Info.plist:

<key>NSFaceIDUsageDescription</key>
<string>$(PRODUCT_NAME) requires FaceID access to allows you quick and secure access.</string>

Extra Configuration

  1. Make sure the following versions are all correct in android/app/build.gradle

    // API v29 enables FaceId
    android {
        compileSdkVersion 29
        buildToolsVersion "29.0.2"
    ...
        defaultConfig {
          targetSdkVersion 29
    
  2. Add necessary rules to android/app/proguard-rules.pro if you are using proguard:

    # MeiZu Fingerprint
    
    // DEPRECATED in 4.0.0
    -keep class com.fingerprints.service.** { *; }
    -dontwarn com.fingerprints.service.**
    
    # Samsung Fingerprint
    
    // DEPRECATED in 4.0.0
    -keep class com.samsung.android.sdk.** { *; }
    -dontwarn com.samsung.android.sdk.**
    

Compatibility

  • For Gradle < 3 you MUST install react-native-fingerprint-scanner at version <= 2.5.0
  • For RN >= 0.57 and/or Gradle >= 3 you MUST install react-native-fingerprint-scanner at version >= 2.6.0
  • For RN >= 0.60 you MUST install react-native-fingerprint-scanner at version >= 3.0.0
  • For Android native Face Unlock, MUST use >= 4.0.0

Example

Example Source Code

iOS Implementation

import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { AlertIOS } from 'react-native';
import FingerprintScanner from 'react-native-fingerprint-scanner';

class FingerprintPopup extends Component {

  componentDidMount() {
    FingerprintScanner
      .authenticate({ description: 'Scan your fingerprint on the device scanner to continue' })
      .then(() => {
        this.props.handlePopupDismissed();
        AlertIOS.alert('Authenticated successfully');
      })
      .catch((error) => {
        this.props.handlePopupDismissed();
        AlertIOS.alert(error.message);
      });
  }

  render() {
    return false;
  }
}

FingerprintPopup.propTypes = {
  handlePopupDismissed: PropTypes.func.isRequired,
};

export default FingerprintPopup;

Android Implementation

import React, { Component } from 'react';
import PropTypes from 'prop-types';
import {
  Alert,
  Image,
  Text,
  TouchableOpacity,
  View,
  ViewPropTypes,
  Platform,
} from 'react-native';

import FingerprintScanner from 'react-native-fingerprint-scanner';
import styles from './FingerprintPopup.component.styles';
import ShakingText from './ShakingText.component';


// - this example component supports both the
//   legacy device-specific (Android < v23) and
//   current (Android >= 23) biometric APIs
// - your lib and implementation may not need both
class BiometricPopup extends Component {
  constructor(props) {
    super(props);
    this.state = {
      errorMessageLegacy: undefined,
      biometricLegacy: undefined
    };

    this.description = null;
  }

  componentDidMount() {
    if (this.requiresLegacyAuthentication()) {
      this.authLegacy();
    } else {
      this.authCurrent();
    }
  }

  componentWillUnmount = () => {
    FingerprintScanner.release();
  }

  requiresLegacyAuthentication() {
    return Platform.Version < 23;
  }

  authCurrent() {
    FingerprintScanner
      .authenticate({ title: 'Log in with Biometrics' })
      .then(() => {
        this.props.onAuthenticate();
      });
  }

  authLegacy() {
    FingerprintScanner
      .authenticate({ onAttempt: this.handleAuthenticationAttemptedLegacy })
      .then(() => {
        this.props.handlePopupDismissedLegacy();
        Alert.alert('Fingerprint Authentication', 'Authenticated successfully');
      })
      .catch((error) => {
        this.setState({ errorMessageLegacy: error.message, biometricLegacy: error.biometric });
        this.description.shake();
      });
  }

  handleAuthenticationAttemptedLegacy = (error) => {
    this.setState({ errorMessageLegacy: error.message });
    this.description.shake();
  };

  renderLegacy() {
    const { errorMessageLegacy, biometricLegacy } = this.state;
    const { style, handlePopupDismissedLegacy } = this.props;

    return (
      <View style={styles.container}>
        <View style={[styles.contentContainer, style]}>

          <Image
            style={styles.logo}
            source={require('./assets/finger_print.png')}
          />

          <Text style={styles.heading}>
            Biometric{'\n'}Authentication
          </Text>
          <ShakingText
            ref={(instance) => { this.description = instance; }}
            style={styles.description(!!errorMessageLegacy)}>
            {errorMessageLegacy || `Scan your ${biometricLegacy} on the\ndevice scanner to continue`}
          </ShakingText>

          <TouchableOpacity
            style={styles.buttonContainer}
            onPress={handlePopupDismissedLegacy}
          >
            <Text style={styles.buttonText}>
              BACK TO MAIN
            </Text>
          </TouchableOpacity>

        </View>
      </View>
    );
  }


  render = () => {
    if (this.requiresLegacyAuthentication()) {
      return this.renderLegacy();
    }

    // current API UI provided by native BiometricPrompt
    return null;
  }
}

BiometricPopup.propTypes = {
  onAuthenticate: PropTypes.func.isRequired,
  handlePopupDismissedLegacy: PropTypes.func,
  style: ViewPropTypes.style,
};

export default BiometricPopup;

API

isSensorAvailable(): (Android, iOS)

Checks if Fingerprint Scanner is able to be used by now.

  • Returns a Promise<string>
  • biometryType: String - The type of biometric authentication supported by the device.
    • iOS: biometryType = 'Touch ID', 'Face ID'
    • Android: biometryType = 'Biometrics'
  • error: FingerprintScannerError { name, message, biometric } - The name and message of failure and the biometric type in use.
componentDidMount() {
  FingerprintScanner
    .isSensorAvailable()
    .then(biometryType => this.setState({ biometryType }))
    .catch(error => this.setState({ errorMessage: error.message }));
}

authenticate({ description, fallbackEnabled }): (iOS)

Starts Fingerprint authentication on iOS.

  • Returns a Promise
  • description: String - the string to explain the request for user authentication.
  • fallbackEnabled: Boolean - default to true, whether to display fallback button (e.g. Enter Password).
componentDidMount() {
  FingerprintScanner
    .authenticate({ description: 'Scan your fingerprint on the device scanner to continue' })
    .then(() => {
      this.props.handlePopupDismissed();
      AlertIOS.alert('Authenticated successfully');
    })
    .catch((error) => {
      this.props.handlePopupDismissed();
      AlertIOS.alert(error.message);
    });
}

authenticate({ title="Log In", subTitle, description, cancelButton="Cancel", onAttempt=() => (null) }): (Android)

Starts Fingerprint authentication on Android.

  • Returns a Promise
  • title: String the title text to display in the native Android popup
  • subTitle: String the sub title text to display in the native Android popup
  • description: String the description text to display in the native Android popup
  • cancelButton: String the cancel button text to display in the native Android popup
  • onAttempt: Function - a callback function when users are trying to scan their fingerprint but failed.
componentDidMount() {
  if (requiresLegacyAuthentication()) {
    authLegacy();
  } else {
    authCurrent();
  }
}

componentWillUnmount = () => {
  FingerprintScanner.release();
}

requiresLegacyAuthentication() {
  return Platform.Version < 23;
}

authCurrent() {
  FingerprintScanner
    .authenticate({ title: 'Log in with Biometrics' })
    .then(() => {
      this.props.onAuthenticate();
    });
}

authLegacy() {
  FingerprintScanner
    .authenticate({ onAttempt: this.handleAuthenticationAttemptedLegacy })
    .then(() => {
      this.props.handlePopupDismissedLegacy();
      Alert.alert('Fingerprint Authentication', 'Authenticated successfully');
    })
    .catch((error) => {
      this.setState({ errorMessageLegacy: error.message, biometricLegacy: error.biometric });
      this.description.shake();
    });
}

handleAuthenticationAttemptedLegacy = (error) => {
  this.setState({ errorMessageLegacy: error.message });
  this.description.shake();
};

release(): (Android)

Stops fingerprint scanner listener, releases cache of internal state in native code, and cancels native prompt if visible.

  • Returns a Void
componentWillUnmount() {
  FingerprintScanner.release();
}

Types of Biometrics

Value OS Description
Touch ID iOS
Face ID iOS
Biometrics Android Refers to the biometric set as preferred on the device

Errors

Name Message
AuthenticationNotMatch No match
AuthenticationFailed Authentication was not successful because the user failed to provide valid credentials
AuthenticationTimeout Authentication was not successful because the operation timed out
AuthenticationProcessFailed 'Sensor was unable to process the image. Please try again
UserCancel Authentication was canceled by the user - e.g. the user tapped Cancel in the dialog
UserFallback Authentication was canceled because the user tapped the fallback button (Enter Password)
SystemCancel Authentication was canceled by system - e.g. if another application came to foreground while the authentication dialog was up
PasscodeNotSet Authentication could not start because the passcode is not set on the device
DeviceLocked Authentication was not successful, the device currently in a lockout of 30 seconds
DeviceLockedPermanent Authentication was not successful, device must be unlocked via password
DeviceOutOfMemory Authentication could not proceed because there is not enough free memory on the device
HardwareError A hardware error occurred
FingerprintScannerUnknownError Could not authenticate for an unknown reason
FingerprintScannerNotSupported Device does not support Fingerprint Scanner
FingerprintScannerNotEnrolled Authentication could not start because Fingerprint Scanner has no enrolled fingers
FingerprintScannerNotAvailable Authentication could not start because Fingerprint Scanner is not available on the device

License

MIT

react-native-fingerprint-scanner's People

Contributors

arcanjoqt avatar chris-griffin avatar dependabot[bot] avatar fkotsian avatar hieuvan-pycogroup avatar hieuvp avatar hoangnm avatar hsjoberg avatar iagormoraes avatar imdaniele avatar jobayer977 avatar lithin avatar maoapp avatar matteodanelli avatar mickamy avatar mikehardy avatar n-rocher avatar neha-brahmankar avatar panda8z avatar petekp avatar phecda avatar phillbaker avatar rajaishwary avatar saeedzhiany avatar sahil290791 avatar salomaoluiz avatar tocalvo avatar tommeier avatar valdio avatar weslleynasrocha avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-native-fingerprint-scanner's Issues

Confused by this commit

In 747c049, the if (mFingerprintIdentify == null) check is removed, so every call to getFingerprintIdentify() results in the creation of a new FingerprintIdentify object.

In getErrorMessage(), this can be called 3 times, meaning 3 objects are created and also duplicate calls to mReactContext.addLifecycleEventListener(this);

Are we sure this is safe to do?

What should I do when attempts is over?

Right now we have a 5 attempts to pass or fail the touchID. What should we do if user failed all 5 attempts? How can we unlock fingerprint to be able to start its loop again? Or, maybe, it is possible to set an attempts number to smth like 9999? I found

public static final int MAX_AVAILABLE_TIMES = Integer.MAX_VALUE;

But seems like changing this value has no affect on our attempts count.
Actually I found the way to unlock it - user must scan valid finger 5 times. But i think there must be another way.

Typescript support

This library will be very most useful if we can use it in typescript based project. so it will be valuable if start creating types declaration file.

Some questions I have met in iOS

Hi @hieuvp I have used your Component in my project, and this component was very good.
But I'm not a OC programmer, so I met some questions when I use your component.Hope you can help me to solve them.

1.I want to When I enter my APP , I need use the fingerprint function to verification the user, what should I do?
2.when UserCancel there was a message show Authentication was canceled by the user - e.g. the user tapped Cancel in the dialog , but I don't want this(I saw Errorshave many situations ), I just want to do somethings not show a dialog, or the message show with Chinese .

That was I met some questions now, thanks a lot!!!

ios popup dismiss

Hi, is there a way to dismiss fingerprint popup?

componentWillUnmount() {
FingerprintScanner.release();
}

leaves popup open on ios.

Get the Asymmetric Keys

Can you get the Asymmetric Keys from any user's fingerprint or even just the public key ?

Looks like you can only verify a fingerprint which was beforehand stored into Android Keystore by the user. Is that correct ?

Is there a way to get the asymmetric keys and probably save it to your server?

Don't work with samsung fingerprint

Tested on android : samsung galaxy s7

FingerprintScanner .isSensorAvailable() .then(result => {}) .catch(error => { console.log('error', error); });

got error :

{ line: 179869, column: 34 }

TypeError: undefined is not an object (evaluating 'ReactNativeFingerprintScanner.isSensorAvailable')

Error Building Android App After Install

Using 2.1.3
react-native 0.46.1

UPDATE: Same results Using ^2.2.0 and react-native ^0.47.0

Since I've installed and linked this library, I get this error when attempting to build for Android:

:app:processDebugResourcesC:\Development\WebDev\sti-wb-react-native\android\app\build\intermediates\res\merged\debug\values-v24\values-v24.xml:3: AAPT: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.

C:\my-app\android\app\build\intermediates\res\merged\debug\values-v24\values-v24.xml:4: AAPT: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'.

C:\my-app\android\app\build\intermediates\res\merged\debug\values-v24\values-v24.xml:3: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.

C:\my-app\android\app\build\intermediates\res\merged\debug\values-v24\values-v24.xml:4: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'.


 FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 8.859 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html

The only difference from my working app is that I have installed and linked the library.

I have not even imported the FingerprintScanner

Results are identical for manual setup.

Package Error

android\app\src\main\java\com\throughbit\MainApplication.java:5: error: package com.rnfingerprint does not exist
import com.rnfingerprint.FingerprintAuthPackage;
^
D:\Throughbit-Mobile\android\app\src\main\java\com\throughbit\MainApplication.java:31: error: cannot find symbol
new FingerprintAuthPackage(),
^
symbol: class FingerprintAuthPackage
2 errors

FAILURE: Build failed with an exception.

Device does not support finger print scanner

This is weird, because there is a phone has supported finger print but getting this error :
Device does not support finger print scanner

device_has_not_support_small

It happened just for this phone, What do you think ?
device : huawei mT7-l09

Authentication was not successful because the user failed to provide valid credentials - throws randomly.

FingerprintScanner.authenticate({
        onAttempt: this.handleAuthenticationAttempted
      })
        .then(() => {
          console.log('success');
          this.setState({ errorMessage: undefined });
          this.handleFingerprintDismissed(true);
        })
        .catch(error => {
          this.setState({ errorMessage: error });
          console.log('errorr', error);
        });

sometimes inside componentdidmount this method returns error

Authentication was not successful because the user failed to provide valid credentials.

even if user didn't scan finger.

Fingerprint Authenticate issue

i got issue undefined is not a function (evaluting 'e.props.handlePopupDismissed()')

Any idea ?

import React,{ Component } from 'react';
import { Platform, ViewPropTypes, Text,View,ScrollView,ImageBackground,Alert,TouchableOpacity,StyleSheet,Dimensions,Image,AsyncStorage,NetInfo } from 'react-native';
import { Navigation } from 'react-native-navigation';
import LinearGradient from 'react-native-linear-gradient';
import axios from 'axios';
import Appurl from './../../config';
import Validation from '../Validation.js';
import Spinner from 'react-native-loading-spinner-overlay';
import * as userActions from '../actions/userActions';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import ModalDropdown from 'react-native-modal-dropdown';
import DeviceInfo from 'react-native-device-info';
import {Container,H1,Button,Content,Left,Body,Right,Icon} from 'native-base';
import {GoogleSignin, GoogleSigninButton} from 'react-native-google-signin';
import FBSDK from 'react-native-fbsdk';
import FingerprintPopup from './Fingerprint';
import FingerprintScanner from 'react-native-fingerprint-scanner';
import ShakingText from './ShakingText';
import styles from './FingerprintDesign';
import PropTypes from 'prop-types';

const {
  LoginManager,
  AccessToken
} = FBSDK;

class TestAndroid extends Component {

    constructor(props) {
      super(props);
      this.state = {
        errorMessage: undefined,
      };
    }
  
    componentDidMount() {
        FingerprintScanner
        .authenticate({ onAttempt: this.handleAuthenticationAttempted })
        .then(() => {
          this.props.handlePopupDismissed();
          Alert.alert('Fingerprint Authentication', 'Authenticated successfully');
        })
        .catch((error) => {
          this.setState({ errorMessage: error.message });
          this.description.shake();
        });
    }
    componentWillUnmount() {
        FingerprintScanner.release();
      }

    
    handleAuthenticationAttempted = (error) => {
        this.setState({ errorMessage: error.message });
        this.description.shake();
      };
  
    render() {
      const { errorMessage } = this.state;
      const { style, handlePopupDismissed } = this.props;
  
      return (
        <View style={styles.container}>
        <View style={[styles.contentContainer, style]}>

          <Image
            style={styles.logo}
            source={require('./../../images/ic_inbox_active.png')}
          />

          <Text style={styles.heading}>
            Fingerprint{'\n'}Authentication
          </Text>
          <ShakingText
            ref={(instance) => { this.description = instance; }}
            style={styles.description(!!errorMessage)}>
            {errorMessage || 'Scan your fingerprint on the\ndevice scanner to continue'}
          </ShakingText>

          <TouchableOpacity
            style={styles.buttonContainer}
            onPress={handlePopupDismissed}
          >
            <Text style={styles.buttonText}>
              BACK TO MAIN
            </Text>
          </TouchableOpacity>

        </View>
      </View>
      );
    }
  }

  TestAndroid.propTypes = {
    style: ViewPropTypes.style,
    handlePopupDismissed: PropTypes.func.isRequired,
  };


function mapStateToProps(state, ownProps) {
  return {
      user: state.user
  };
}
function mapDispatchToProps(dispatch) {
  return {
      actions: bindActionCreators(userActions, dispatch)
  };
}
export default connect(mapStateToProps, mapDispatchToProps)(TestAndroid);

Fallback option not appearing in iOS simulator running iOS 11

This library is cool but I am not getting fallback option where a user could enter password.

Here is my code:

FingerprintScanner
        .authenticate({
          onAttempt: this.handleAuthenticationAttempted,
          description: 'Scan your fingerprint on the device scanner to continue',
          fallbackEnabled: true,
        })
        .then(() => {
          this.fingerprintSuccess();
        })
        .catch((error) => {
          this.setState({ error });
          if (Platform.OS === 'ios' && !isUndefined(error) && error.name === 'AuthenticationFailed') {
            AlertIOS.alert('Touch ID for example', error.message, [
              {
                text: 'Ok',
                onPress: () => this.enableFingerprintScanner(this.props),
              },
            ]);
          }
        });

Additional Details:

  • RN: 0.42.3
  • react-native-fingerprint-scanner: 2.2.1

isSensorAvailable function doesn't get correct fingerprint state

here's a thing, I use isSensorAvailable method in ComponentDidMount , it's works;
when I back homePage, delete fingerprint in system, and back to App , use isSensorAvailable method , then get wrong state; seem like it's just works in first time?

here my code:

componentDidMount(){
        FingerprintScanner.isSensorAvailable().then((biometryType) => {
            console.log(biometryType);
            this.setState({ isSupportFinger: true});
        }).catch((error) => { 
          ...do something
       })
}

// when change AppState, active to back, back to active; 
AppStateChangedListener(appState){
   //when appState is active ,check fringerprint isSensorAvailable
   FingerprintScanner.isSensorAvailable().then((biometryType) => {
            console.log(biometryType);
            this.setState({ isSupportFinger: true});
        }).catch((error) => { 
          ...do something
       })
  // can't return right state;  same as first time  (ComponentDidMount)
}

Cannot read property 'isSensorAvailable' of undefined

I tried to clone the example and ran it on my android. but it showed the error that the property 'isSensorAvailable' is undefined. I tried to debug the FingerprintScanner and i saw the isSensorAvailable function there. Here's some screenshoot :

(the problem i faced)
screenshot

(the debug i have done)
captunnre

(the result)
captummre

What exactly the problem i face? thanks.

【iOS】Have any way to use the Native IOS's fingerprint?

hi,I have a question that have any way to use the Native IOS's fingerprint?
I find that your component was create a new page to open the fingerprint function.
But in the other app, they just use a radio to control the fingerprint.
Thx so much!

Error running gradle scripts

I am trying to use the library but I get an error when it runs the gradle scripts:

:react-native-fingerprint-scanner:preDebugAndroidTestBuild UP-TO-DATE
:react-native-fingerprint-scanner:preDebugBuild UP-TO-DATE
:react-native-fingerprint-scanner:preDebugUnitTestBuild UP-TO-DATE
:react-native-fingerprint-scanner:preReleaseUnitTestBuild UP-TO-DATE
:react-native-fingerprint-scanner:prepareComAndroidSupportAnimatedVectorDrawable2531Library FAILED
    
FAILURE: Build failed with an exception.
    
    * What went wrong:
    null value in entry: explodedDir=null

It was working before and suddenly started to do that. Did something get updated? I don't see any changes or new release.

iPhone XS crash without erros when try to use FaceID

Al works out in android and ios. (Real devices) But in iPhone XS simulator with FaceID Enrolled and Info.plist not:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>CFBundleDevelopmentRegion</key>
	<string>en</string>
	<key>CFBundleDisplayName</key>
	<string>visionariosBolsaAppTest</string>
	<key>CFBundleExecutable</key>
	<string>$(EXECUTABLE_NAME)</string>
	<key>CFBundleIdentifier</key>
	<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
	<key>CFBundleInfoDictionaryVersion</key>
	<string>6.0</string>
	<key>CFBundleName</key>
	<string>$(PRODUCT_NAME)</string>
	<key>CFBundlePackageType</key>
	<string>APPL</string>
	<key>CFBundleShortVersionString</key>
	<string>1.0</string>
	<key>CFBundleSignature</key>
	<string>????</string>
	<key>CFBundleVersion</key>
	<string>1</string>
	<key>NSFaceIDUsageDescription</key>
	<string>Enabling Face ID allows you quick and secure access to your account.</string>
	<key>LSRequiresIPhoneOS</key>
	<true/>
	<key>NSAppTransportSecurity</key>
	<dict>
		<key>NSExceptionDomains</key>
		<dict>
			<key>localhost</key>
			<dict>
				<key>NSExceptionAllowsInsecureHTTPLoads</key>
				<true/>
			</dict>
		</dict>
	</dict>
	<key>NSLocationWhenInUseUsageDescription</key>
	<string/>
	<key>UIAppFonts</key>
	<array>
		<string>Entypo.ttf</string>
		<string>EvilIcons.ttf</string>
		<string>Feather.ttf</string>
		<string>FontAwesome.ttf</string>
		<string>Foundation.ttf</string>
		<string>Ionicons.ttf</string>
		<string>MaterialCommunityIcons.ttf</string>
		<string>MaterialIcons.ttf</string>
		<string>Octicons.ttf</string>
		<string>Roboto_medium.ttf</string>
		<string>Roboto.ttf</string>
		<string>rubicon-icon-font.ttf</string>
		<string>SimpleLineIcons.ttf</string>
		<string>Zocial.ttf</string>
		<string>FontAwesome5_Brands.ttf</string>
		<string>FontAwesome5_Regular.ttf</string>
		<string>FontAwesome5_Solid.ttf</string>
	</array>
	<key>UILaunchStoryboardName</key>
	<string>LaunchScreen</string>
	<key>UIRequiredDeviceCapabilities</key>
	<array>
		<string>armv7</string>
	</array>
	<key>UISupportedInterfaceOrientations</key>
	<array>
		<string>UIInterfaceOrientationPortrait</string>
		<string>UIInterfaceOrientationLandscapeLeft</string>
		<string>UIInterfaceOrientationLandscapeRight</string>
	</array>
	<key>UIViewControllerBasedStatusBarAppearance</key>
	<false/>
</dict>
</plist>

Example code instrucctions error

In the source code example I don't see:

Add new ReactNativeFingerprintScannerPackage() to the list returned by the getPackages() method

[Crash] FingerprintPopup makes the app crashes

Hello,
I have last version of react native and my gradle is okay. I did the installation the right way regarding to your guide. I can run my app but once I've added the "example" folder the app creashes... I have removed ios file because I use android only and I have removed "android" in the filename because in the code there is no "android" in the pathname of the import.

I think the crash come from FingerprintPopup because when I remove this import and this code below, it doesn't crash.

const { errorMessage, popupShowed } = this.state;

//...

{errorMessage && (
  <Text style={styles.errorMessage}>
    {errorMessage}
  </Text>
)}

{popupShowed && (
  <FingerprintPopup
    style={styles.popup}
    handlePopupDismissed={this.handleFingerprintDismissed}
  />
)}

Why does the app crashes please ? There is no error at all...

Help please :)

Android: same config but not posible to run

$ react-native run-android
Scanning folders for symlinks in /Volumes/HDD/Projects/VisionariosBolsa/visionarios-bolsa-app/app/node_modules (11ms)
JS server already running.
Building and installing the app on the device (cd android && ./gradlew installDebug)...
NDK is missing a "platforms" directory.
If you are using NDK, verify the ndk.dir is set to a valid NDK directory.  It is currently set to /Volumes/HDD/Library/Android/sdk/ndk-bundle.
If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.

NDK is missing a "platforms" directory.
If you are using NDK, verify the ndk.dir is set to a valid NDK directory.  It is currently set to /Volumes/HDD/Library/Android/sdk/ndk-bundle.
If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.

NDK is missing a "platforms" directory.
If you are using NDK, verify the ndk.dir is set to a valid NDK directory.  It is currently set to /Volumes/HDD/Library/Android/sdk/ndk-bundle.
If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.

NDK is missing a "platforms" directory.
If you are using NDK, verify the ndk.dir is set to a valid NDK directory.  It is currently set to /Volumes/HDD/Library/Android/sdk/ndk-bundle.
If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.

:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareAndroidArchLifecycleRuntime100Library
:app:prepareComAndroidSupportAnimatedVectorDrawable2610Library
:app:prepareComAndroidSupportAppcompatV72610Library
:app:prepareComAndroidSupportSupportCompat2610Library
:app:prepareComAndroidSupportSupportCoreUi2610Library
:app:prepareComAndroidSupportSupportCoreUtils2610Library
:app:prepareComAndroidSupportSupportFragment2610Library
:app:prepareComAndroidSupportSupportMediaCompat2610Library
:app:prepareComAndroidSupportSupportV42610Library
:app:prepareComAndroidSupportSupportVectorDrawable2610Library
:app:prepareComFacebookFbuiTextlayoutbuilderTextlayoutbuilder100Library
:app:prepareComFacebookFrescoDrawee190Library
:app:prepareComFacebookFrescoFbcore190Library
:app:prepareComFacebookFrescoFresco190Library
:app:prepareComFacebookFrescoImagepipeline190Library
:app:prepareComFacebookFrescoImagepipelineBase190Library
:app:prepareComFacebookFrescoImagepipelineOkhttp3190Library
:app:prepareComFacebookReactReactNative0561Library
:app:prepareComFacebookSoloaderSoloader030Library
:app:prepareComGoogleAndroidExoplayerExoplayer273Library
:app:prepareComGoogleAndroidExoplayerExoplayerCore273Library
:app:prepareComGoogleAndroidExoplayerExoplayerDash273Library
:app:prepareComGoogleAndroidExoplayerExoplayerHls273Library
:app:prepareComGoogleAndroidExoplayerExoplayerSmoothstreaming273Library
:app:prepareComGoogleAndroidExoplayerExoplayerUi273Library
:app:prepareComGoogleAndroidExoplayerExtensionOkhttp273Library
:app:prepareComWeiAndroidLibFingerprintidentify121Library
:app:prepareOrgWebkitAndroidJscR174650Library
:react-native-fingerprint-scanner:preBuild UP-TO-DATE
:react-native-fingerprint-scanner:preReleaseBuild UP-TO-DATE
:react-native-fingerprint-scanner:checkReleaseManifest
:react-native-fingerprint-scanner:preDebugAndroidTestBuild UP-TO-DATE
:react-native-fingerprint-scanner:preDebugBuild UP-TO-DATE
:react-native-fingerprint-scanner:preDebugUnitTestBuild UP-TO-DATE
:react-native-fingerprint-scanner:preReleaseUnitTestBuild UP-TO-DATE
:react-native-fingerprint-scanner:prepareAndroidArchLifecycleRuntime100Library
:react-native-fingerprint-scanner:prepareComAndroidSupportAnimatedVectorDrawable2610Library
:react-native-fingerprint-scanner:prepareComAndroidSupportAppcompatV72610Library
:react-native-fingerprint-scanner:prepareComAndroidSupportSupportCompat2610Library
:react-native-fingerprint-scanner:prepareComAndroidSupportSupportCoreUi2610Library
:react-native-fingerprint-scanner:prepareComAndroidSupportSupportCoreUtils2610Library
:react-native-fingerprint-scanner:prepareComAndroidSupportSupportFragment2610Library
:react-native-fingerprint-scanner:prepareComAndroidSupportSupportMediaCompat2610Library
:react-native-fingerprint-scanner:prepareComAndroidSupportSupportV42610Library
:react-native-fingerprint-scanner:prepareComAndroidSupportSupportVectorDrawable2610Library
:react-native-fingerprint-scanner:prepareComFacebookFbuiTextlayoutbuilderTextlayoutbuilder100Library
:react-native-fingerprint-scanner:prepareComFacebookFrescoDrawee190Library
:react-native-fingerprint-scanner:prepareComFacebookFrescoFbcore190Library
:react-native-fingerprint-scanner:prepareComFacebookFrescoFresco190Library
:react-native-fingerprint-scanner:prepareComFacebookFrescoImagepipeline190Library
:react-native-fingerprint-scanner:prepareComFacebookFrescoImagepipelineBase190Library
:react-native-fingerprint-scanner:prepareComFacebookFrescoImagepipelineOkhttp3190Library
:react-native-fingerprint-scanner:prepareComFacebookReactReactNative0561Library
:react-native-fingerprint-scanner:prepareComFacebookSoloaderSoloader030Library
:react-native-fingerprint-scanner:prepareComWeiAndroidLibFingerprintidentify121Library
:react-native-fingerprint-scanner:prepareOrgWebkitAndroidJscR174650Library
:react-native-fingerprint-scanner:prepareReleaseDependencies
:react-native-fingerprint-scanner:compileReleaseAidl
:react-native-fingerprint-scanner:compileReleaseNdk NO-SOURCE
:react-native-fingerprint-scanner:compileLint
:react-native-fingerprint-scanner:copyReleaseLint NO-SOURCE
:react-native-fingerprint-scanner:compileReleaseRenderscript
:react-native-fingerprint-scanner:generateReleaseBuildConfig
:react-native-fingerprint-scanner:generateReleaseResValues
:react-native-fingerprint-scanner:generateReleaseResources
:react-native-fingerprint-scanner:mergeReleaseResources
:react-native-fingerprint-scanner:processReleaseManifest
:react-native-fingerprint-scanner:processReleaseResources
/Volumes/HDD/Projects/VisionariosBolsa/visionarios-bolsa-app/app/node_modules/react-native-fingerprint-scanner/android/build/intermediates/res/merged/release/values-v26/values-v26.xml:15:21-54: AAPT: No resource found that matches the given name: attr 'android:keyboardNavigationCluster'.

/Volumes/HDD/Projects/VisionariosBolsa/visionarios-bolsa-app/app/node_modules/react-native-fingerprint-scanner/android/build/intermediates/res/merged/release/values-v26/values-v26.xml:15: error: Error: No resource found that matches the given name: attr 'android:keyboardNavigationCluster'.


:react-native-fingerprint-scanner:processReleaseResources FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-fingerprint-scanner:processReleaseResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 2.565 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html

How to determine touch id is turn off

My device is supported touch id but i turn off touch id feature.
isSupported method can check touch id is supported or not
How can i determine that touch id is turn off

isSensorAvailable() method returns boolean(true or false) value instead of biometryType value(Touch ID,Face ID)

FingerprintScanner.isSensorAvailable().then(biometryType => {
console.log(
"fingerprintScannerAvailable available",
biometryType
); }).catch(err => {
console.log("fingerprintScannerAvailable not available");
});

React-Native version:0.56.0
"react-native-fingerprint-scanner": "^2.3.2",

actual result: isSensorAvailable() return true if any(touch ID or face ID) of the sensor available otherwise false
expected result: it should return biometryType value(value: Touch ID,Face ID). currently i am getting boolean value

undefined is not an object

i do the same as your read.me and the app can run. but! at the app start i got some error
undefined is not an object(evaluating 'ReactNativeFingerprintScanner.isSensorAvailable').

i dont know what's wrong

FaceID not working

Application crashes while authenticating for FaceID.

FingerprintScanner
.authenticate({ description: 'Scan your fingerprint on the device scanner to continue' })
.then(() => {
this.props.onSuccess();
})
.catch((error) => {
this.props.onCancel();
});

This piece of code fails for faceID however, TouchID/Fingerprint works perfectly fine for both iOS and android.

Environment:
OS: macOS High Sierra 10.13.4
Node: 9.8.0
Yarn: 1.3.2
npm: 5.8.0
Watchman: 4.9.0
Xcode: Xcode 9.3.1 Build version 9E501
Android Studio: 3.0 AI-171.4443003

Packages: (wanted => installed)
react: ^16.3.1 => 16.5.2
react-native: ^0.55.0 => 0.55.3

'react-native-fingerprint-scanner' => 2.5.0v
using iPhone X (11.3)

I'm getting an error FingerprintScannerNotEnrolled.

Complete error says:
07-21 11:23:06.433 4639 5443 I ReactNativeJS: { [FingerprintScannerNotEnrolled: Authentication could not start because Fingerprint Scanner has no enrolled fingers.] name: 'FingerprintScannerNotEnrolled' }

What does this mean?

Some details about my environment:
"react": "^16.0.0-alpha.6",
"react-native": "^0.44.0",
"react-native-fingerprint-scanner": "^2.1.3",

My code:


  componentDidMount() {
    if (Platform.OS === 'ios') {
      console.log('ios device, trying to use fingerprint scanner')
      // iOS code only
      FingerprintScanner
        .authenticate({ description: 'Scan your fingerprint on the device scanner to continue' })
        .then(() => {
          AlertIOS.alert('Authenticated successfully')
        })
        .catch((error) => {
          console.log(error)
        })
    } else if (Platform.OS === 'android') {
      console.log('android device, trying to use fingerprint scanner')
      // android code only
      FingerprintScanner
        .authenticate({ onAttempt: this.handleAuthenticationAttempted })
        .then(() => {
          Alert.alert('Fingerprint Authentication', 'Authenticated successfully')
        })
        .catch((error) => {
          console.log(error)
        })
    }
  }

  componentWillUnmount() {
    if (Platform.OS === 'android') {
      FingerprintScanner.release()
    }
  }

Document iOS FaceID Info.plist requirement

Please add config add key "NSFaceIDUsageDescription" with value "Need your face to unlock secrets!" to run Face ID on iPhone X.

If not have that key. I can not use Face ID

Support RN > 0.47

/node_modules/react-native-fingerprint-scanner/android/src/main/java/com/hieuvp/fingerprint/ReactNativeFingerprintScannerPackage.java:20: error: method does not override or implement a method from a supertype
@OverRide
^
1 error
:react-native-fingerprint-scanner:compileReleaseJavaWithJavac FAILED

Unable to build production app

Unable to build production app with RN 0.57 and android

What went wrong:
Execution failed for task ':react-native-fingerprint-scanner:verifyReleaseResources'.

java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
Output: /home/justdial/react_projects/myjd_code/hrlite/node_modules/react-native-fingerprint-scanner/android/build/intermediates/res/merged/release/values-v26/values-v26.xml:7: error: resource android:attr/colorError not found.
/home/justdial/react_projects/myjd_code/hrlite/node_modules/react-native-fingerprint-scanner/android/build/intermediates/res/merged/release/values-v26/values-v26.xml:11: error: resource android:attr/colorError not found.
/home/justdial/react_projects/myjd_code/hrlite/node_modules/react-native-fingerprint-scanner/android/build/intermediates/res/merged/release/values-v26/values-v26.xml:15: error: style attribute 'android:attr/keyboardNavigationCluster' not found.
/home/justdial/react_projects/myjd_code/hrlite/node_modules/react-native-fingerprint-scanner/android/build/intermediates/res/merged/release/values/values.xml:226: error: resource android:attr/fontStyle not found.
/home/justdial/react_projects/myjd_code/hrlite/node_modules/react-native-fingerprint-scanner/android/build/intermediates/res/merged/release/values/values.xml:226: error: resource android:attr/font not found.
/home/justdial/react_projects/myjd_code/hrlite/node_modules/react-native-fingerprint-scanner/android/build/intermediates/res/merged/release/values/values.xml:226: error: resource android:attr/fontWeight not found.
error: failed linking references.

Command: /home/justdial/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.0-4818971-linux.jar/6939bd2e3845c1dff5341c63b61e5547/aapt2-3.2.0-4818971-linux/aapt2 link -I
/home/justdial/Android/Sdk/platforms/android-25/android.jar
--manifest
/home/justdial/react_projects/myjd_code/hrlite/node_modules/react-native-fingerprint-scanner/android/build/intermediates/aapt_friendly_merged_manifests/release/processReleaseManifest/aapt/AndroidManifest.xml
-o
/tmp/aapt-5994702613927831493-out
-R
/home/justdial/react_projects/myjd_code/hrlite/node_modules/react-native-fingerprint-scanner/android/build/intermediates/res/compiled/release/layout_abc_screen_content_include.xml.flat\

How ready is this project for production?

I've been very interested in this project. I'm actually shocked to find this. I had searched a bunch projects. It's the only one which is compatible with iOS and Android. How ready is this to be used in production?

face id is not working on some devices

I have tested with 4 iphoneX devices, and 2 out of 4 fail on

import TouchID from 'react-native-fingerprint-scanner';
return await TouchID.authenticate(param) method.

It always crashes on iphone X simulator.

I am using - "react-native-fingerprint-scanner": "^2.5.0",

getting "FingerprintScannerError" error on iOS device when i am trying use either FingerprintScanner.authenticate() or isSensorAvailable()

here is my code, which is exactly same as the given in example project code -

FingerprintPopup.ios file --

componentDidMount() {
FingerprintScanner
.authenticate({ description: 'Scan your fingerprint on the device scanner to continue' })
.then(() => {
this.props.handlePopupDismissed(true);
})
.catch((error) => {
console.log(error);
});
}

componentWillUnmount() {
FingerprintScanner.release();
}

render() {
return false;
}
}`

inside app.js --

`useTouchId = () =>{
FingerprintScanner
.isSensorAvailable()
.then(biometryType => {
console.log("***** biometric found --- ", biometryType);
this.isTouchAvailable = true;
this.handleFingerprintShowed();
})
.catch(error => {
console.log("****** biometric not found --- ", error);
this.isTouchAvailable = false;
});
}

handleFingerprintShowed = () => {
this.setState({ popupShowed: true });
};

handleFingerprintDismissed = (result) => {
result ? this.performAction() : this.setState({ popupShowed: false });
};

componentWillUnmount(){
console.log("Pin componentWillUnmount");
FingerprintScanner.release();
}`

I have fingerprints registered in my iOS device, still getting the error while using the above mentioned functions. Please help me here.

Error ->
FingerprintScannerError {name: "FingerprintScannerNotSupported", stack: "FingerprintScannerNotSupported↵ at _default (bl…8.43.145:8081/debugger-ui/debuggerWorker.js:72:58"}
name: "FingerprintScannerNotSupported"
stack: "FingerprintScannerNotSupported↵ at _default (blob:http://192.168.43.145:8081/0281a052-c6e0-4e0b-a408-228ddf97cbf5:125886:12)↵ at blob:http://192.168.43.145:8081/0281a052-c6e0-4e0b-a408-228ddf97cbf5:125813:50↵ at MessageQueue.__invokeCallback (blob:http://192.168.43.145:8081/0281a052-c6e0-4e0b-a408-228ddf97cbf5:4415:18)↵ at blob:http://192.168.43.145:8081/0281a052-c6e0-4e0b-a408-228ddf97cbf5:4166:18↵ at MessageQueue.__guard (blob:http://192.168.43.145:8081/0281a052-c6e0-4e0b-a408-228ddf97cbf5:4318:13)↵ at MessageQueue.invokeCallbackAndReturnFlushedQueue (blob:http://192.168.43.145:8081/0281a052-c6e0-4e0b-a408-228ddf97cbf5:4165:14)↵ at http://192.168.43.145:8081/debugger-ui/debuggerWorker.js:72:58"
proto: Wrapper

Question regarding sensor not available

If the device does not support the sensor can I substitute it for a pin and is it possible to tie the "fingerprint" to a pin value so that the back end only verifies the pin regardless of whether an actual pin is submitted or the fingerprint is used?

[ANDROID] Installation Instructions Incomplete

Instructions do not include instructions to add the package to the MainApplicationJava. It is present in the Android Example code but not in the directions for setup.

Should instruct users to add the import statement to the MainApplicationJava as well as the package to the getPackages function.

import com.hieuvp.fingerprint.ReactNativeFingerprintScannerPackage;

new ReactNativeFingerprintScannerPackage()

Unable to create a release build after adding fingerprint-scanner library

Update:

The app works fine if I add -ignorewarnings at the end of proguard-rules.pro. Not sure if this is the correct way of doing it. @hieuvp can you please confirm if this the right of doing it?

Description

The app works fine in debug mode, but the moment I try creating a release build, it keeps failing with this error:

Note: the configuration keeps the entry point 'okhttp3.internal.framed.Hpack { okio.ByteString checkLowercase(okio.ByteString); }', but not the descriptor class 'okio.ByteString'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.Hpack { okio.ByteString access$100(okio.ByteString); }', but not the descriptor class 'okio.ByteString'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.Hpack$Reader { Hpack$Reader(int,okio.Source); }', but not the descriptor class 'okio.Source'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.Hpack$Reader { Hpack$Reader(int,int,okio.Source); }', but not the descriptor class 'okio.Source'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.Hpack$Writer { Hpack$Writer(okio.Buffer); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.Hpack$Writer { Hpack$Writer(int,okio.Buffer); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.Hpack$Writer { void writeByteString(okio.ByteString); }', but not the descriptor class 'okio.ByteString'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.Http2 { okhttp3.internal.framed.FrameReader newReader(okio.BufferedSource,boolean); }', but not the descriptor class 'okio.BufferedSource'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.Http2 { okhttp3.internal.framed.FrameWriter newWriter(okio.BufferedSink,boolean); }', but not the descriptor class 'okio.BufferedSink'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.Http2 { int readMedium(okio.BufferedSource); }', but not the descriptor class 'okio.BufferedSource'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.Http2 { void writeMedium(okio.BufferedSink,int); }', but not the descriptor class 'okio.BufferedSink'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.Http2 { int access$300(okio.BufferedSource); }', but not the descriptor class 'okio.BufferedSource'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.Http2 { void access$600(okio.BufferedSink,int); }', but not the descriptor class 'okio.BufferedSink'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.Http2$ContinuationSource { Http2$ContinuationSource(okio.BufferedSource); }', but not the descriptor class 'okio.BufferedSource'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.Http2$ContinuationSource { long read(okio.Buffer,long); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.Http2$Reader { Http2$Reader(okio.BufferedSource,int,boolean); }', but not the descriptor class 'okio.BufferedSource'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.Http2$Writer { Http2$Writer(okio.BufferedSink,boolean); }', but not the descriptor class 'okio.BufferedSink'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.Http2$Writer { void data(boolean,int,okio.Buffer,int); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.Http2$Writer { void dataFrame(int,byte,okio.Buffer,int); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.NameValueBlockReader { NameValueBlockReader(okio.BufferedSource); }', but not the descriptor class 'okio.BufferedSource'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.NameValueBlockReader$1 { NameValueBlockReader$1(okhttp3.internal.framed.NameValueBlockReader,okio.Source); }', but not the descriptor class 'okio.Source'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.NameValueBlockReader$1 { long read(okio.Buffer,long); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.PushObserver { boolean onData(int,okio.BufferedSource,int,boolean); }', but not the descriptor class 'okio.BufferedSource'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.PushObserver$1 { boolean onData(int,okio.BufferedSource,int,boolean); }', but not the descriptor class 'okio.BufferedSource'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.Spdy3 { okhttp3.internal.framed.FrameReader newReader(okio.BufferedSource,boolean); }', but not the descriptor class 'okio.BufferedSource'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.Spdy3 { okhttp3.internal.framed.FrameWriter newWriter(okio.BufferedSink,boolean); }', but not the descriptor class 'okio.BufferedSink'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.Spdy3$Reader { Spdy3$Reader(okio.BufferedSource,boolean); }', but not the descriptor class 'okio.BufferedSource'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.Spdy3$Writer { Spdy3$Writer(okio.BufferedSink,boolean); }', but not the descriptor class 'okio.BufferedSink'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.Spdy3$Writer { void data(boolean,int,okio.Buffer,int); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.Spdy3$Writer { void sendDataFrame(int,int,okio.Buffer,int); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.Variant { okhttp3.internal.framed.FrameReader newReader(okio.BufferedSource,boolean); }', but not the descriptor class 'okio.BufferedSource'
Note: the configuration keeps the entry point 'okhttp3.internal.framed.Variant { okhttp3.internal.framed.FrameWriter newWriter(okio.BufferedSink,boolean); }', but not the descriptor class 'okio.BufferedSink'
Note: the configuration keeps the entry point 'okhttp3.internal.http.Http1xStream { Http1xStream(okhttp3.OkHttpClient,okhttp3.internal.connection.StreamAllocation,okio.BufferedSource,okio.BufferedSink); }', but not the descriptor class 'okio.BufferedSource'
Note: the configuration keeps the entry point 'okhttp3.internal.http.Http1xStream { Http1xStream(okhttp3.OkHttpClient,okhttp3.internal.connection.StreamAllocation,okio.BufferedSource,okio.BufferedSink); }', but not the descriptor class 'okio.BufferedSink'
Note: the configuration keeps the entry point 'okhttp3.internal.http.Http1xStream { void detachTimeout(okio.ForwardingTimeout); }', but not the descriptor class 'okio.ForwardingTimeout'
Note: the configuration keeps the entry point 'okhttp3.internal.http.Http1xStream { void access$400(okhttp3.internal.http.Http1xStream,okio.ForwardingTimeout); }', but not the descriptor class 'okio.ForwardingTimeout'
Note: the configuration keeps the entry point 'okhttp3.internal.http.Http1xStream$ChunkedSink { void write(okio.Buffer,long); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okhttp3.internal.http.Http1xStream$ChunkedSource { long read(okio.Buffer,long); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okhttp3.internal.http.Http1xStream$FixedLengthSink { void write(okio.Buffer,long); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okhttp3.internal.http.Http1xStream$FixedLengthSource { long read(okio.Buffer,long); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okhttp3.internal.http.Http1xStream$UnknownLengthSource { long read(okio.Buffer,long); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okhttp3.internal.http.Http2xStream$StreamFinishingSource { Http2xStream$StreamFinishingSource(okhttp3.internal.http.Http2xStream,okio.Source); }', but not the descriptor class 'okio.Source'
Note: the configuration keeps the entry point 'okhttp3.internal.http.RealResponseBody { RealResponseBody(okhttp3.Headers,okio.BufferedSource); }', but not the descriptor class 'okio.BufferedSource'
Note: the configuration keeps the entry point 'okhttp3.internal.huc.BufferedRequestBody { void writeTo(okio.BufferedSink); }', but not the descriptor class 'okio.BufferedSink'
Note: the configuration keeps the entry point 'okhttp3.internal.huc.OutputStreamRequestBody { void initOutputStream(okio.BufferedSink,long); }', but not the descriptor class 'okio.BufferedSink'
Note: the configuration keeps the entry point 'okhttp3.internal.huc.OutputStreamRequestBody$1 { OutputStreamRequestBody$1(okhttp3.internal.huc.OutputStreamRequestBody,long,okio.BufferedSink); }', but not the descriptor class 'okio.BufferedSink'
Note: the configuration keeps the entry point 'okhttp3.internal.huc.StreamedRequestBody { void writeTo(okio.BufferedSink); }', but not the descriptor class 'okio.BufferedSink'
Note: the configuration keeps the entry point 'okhttp3.internal.ws.RealWebSocket { RealWebSocket(boolean,okio.BufferedSource,okio.BufferedSink,java.util.Random,java.util.concurrent.Executor,okhttp3.ws.WebSocketListener,java.lang.String); }', but not the descriptor class 'okio.BufferedSource'
Note: the configuration keeps the entry point 'okhttp3.internal.ws.RealWebSocket { RealWebSocket(boolean,okio.BufferedSource,okio.BufferedSink,java.util.Random,java.util.concurrent.Executor,okhttp3.ws.WebSocketListener,java.lang.String); }', but not the descriptor class 'okio.BufferedSink'
Note: the configuration keeps the entry point 'okhttp3.internal.ws.RealWebSocket { void sendPing(okio.Buffer); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okhttp3.internal.ws.RealWebSocket { void sendPong(okio.Buffer); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okhttp3.internal.ws.RealWebSocket$1 { void onPing(okio.Buffer); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okhttp3.internal.ws.RealWebSocket$1 { void onPong(okio.Buffer); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okhttp3.internal.ws.RealWebSocket$1$1 { RealWebSocket$1$1(okhttp3.internal.ws.RealWebSocket$1,java.lang.String,java.lang.Object[],okio.Buffer); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okhttp3.internal.ws.WebSocketReader { WebSocketReader(boolean,okio.BufferedSource,okhttp3.internal.ws.WebSocketReader$FrameCallback); }', but not the descriptor class 'okio.BufferedSource'
Note: the configuration keeps the entry point 'okhttp3.internal.ws.WebSocketReader$1 { WebSocketReader$1(okhttp3.internal.ws.WebSocketReader,okhttp3.MediaType,okio.BufferedSource); }', but not the descriptor class 'okio.BufferedSource'
Note: the configuration keeps the entry point 'okhttp3.internal.ws.WebSocketReader$FrameCallback { void onPing(okio.Buffer); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okhttp3.internal.ws.WebSocketReader$FrameCallback { void onPong(okio.Buffer); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okhttp3.internal.ws.WebSocketReader$FramedMessageSource { long read(okio.Buffer,long); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okhttp3.internal.ws.WebSocketWriter { WebSocketWriter(boolean,okio.BufferedSink,java.util.Random); }', but not the descriptor class 'okio.BufferedSink'
Note: the configuration keeps the entry point 'okhttp3.internal.ws.WebSocketWriter { void writePing(okio.Buffer); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okhttp3.internal.ws.WebSocketWriter { void writePong(okio.Buffer); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okhttp3.internal.ws.WebSocketWriter { void writeControlFrameSynchronized(int,okio.Buffer); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okhttp3.internal.ws.WebSocketWriter { void writeMaskedSynchronized(okio.BufferedSource,long); }', but not the descriptor class 'okio.BufferedSource'
Note: the configuration keeps the entry point 'okhttp3.internal.ws.WebSocketWriter$FrameSink { void write(okio.Buffer,long); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okhttp3.ws.WebSocket { void sendPing(okio.Buffer); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okhttp3.ws.WebSocketListener { void onPong(okio.Buffer); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okio.AsyncTimeout { void scheduleTimeout(okio.AsyncTimeout,long,boolean); }', but not the descriptor class 'okio.AsyncTimeout'
Note: the configuration keeps the entry point 'okio.AsyncTimeout { boolean cancelScheduledTimeout(okio.AsyncTimeout); }', but not the descriptor class 'okio.AsyncTimeout'
Note: the configuration keeps the entry point 'okio.AsyncTimeout { okio.Sink sink(okio.Sink); }', but not the descriptor class 'okio.Sink'
Note: the configuration keeps the entry point 'okio.AsyncTimeout { okio.Source source(okio.Source); }', but not the descriptor class 'okio.Source'
Note: the configuration keeps the entry point 'okio.ForwardingSink { ForwardingSink(okio.Sink); }', but not the descriptor class 'okio.Sink'
Note: the configuration keeps the entry point 'okio.ForwardingSink { void write(okio.Buffer,long); }', but not the descriptor class 'okio.Buffer'
Note: the configuration keeps the entry point 'okio.ForwardingSource { ForwardingSource(okio.Source); }', but not the descriptor class 'okio.Source'
Note: the configuration keeps the entry point 'okio.ForwardingSource { long read(okio.Buffer,long); }', but not the descriptor class 'okio.Buffer'
Note: there were 3 references to unknown classes.
      You should check your configuration for typos.
      (http://proguard.sourceforge.net/manual/troubleshooting.html#unknownclass)
Note: there were 893 unkept descriptor classes in kept class members.
      You should consider explicitly keeping the mentioned classes
      (using '-keep').
      (http://proguard.sourceforge.net/manual/troubleshooting.html#descriptorclass)
Note: there were 18 unresolved dynamic references to classes or interfaces.
      You should check if you need to specify additional program jars.
      (http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclass)
Note: there were 5 accesses to class members by means of introspection.
      You should consider explicitly keeping the mentioned class members
      (using '-keep' or '-keepclassmembers').
      (http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclassmember)
Warning: there were 2 unresolved references to classes or interfaces.
         You may need to add missing library jars or update their versions.
         If your code works fine without the missing classes, you can suppress
         the warnings with '-dontwarn' options.
         (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass)
Warning: Exception while processing task java.io.IOException: Please correct the above warnings first.
:app:transformClassesAndResourcesWithProguardForRelease FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'.
> Job failed, see logs for details

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

I am using:
React Native: 0.42.3
react-native-fingerprint-scanner: 2.2.0
compileSdkVersion: 25
buildToolsVersion "25.0.3"
minSdkVersion 21
targetSdkVersion 25

I have even added these lines to proguard:

# MeiZu Fingerprint
-keep class com.fingerprints.service.** { *; }

# Samsung Fingerprint
-keep class com.samsung.** {*;}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.