File tree Expand file tree Collapse file tree 4 files changed +15
-3
lines changed
src/main/java/com/hieuvp/fingerprint Expand file tree Collapse file tree 4 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -311,6 +311,7 @@ componentWillUnmount() {
311311| FingerprintScannerNotEnrolled | Authentication could not start because Fingerprint Scanner has no enrolled fingers |
312312| FingerprintScannerUnknownError | Could not authenticate for an unknown reason |
313313| FingerprintScannerNotSupported | Device does not support Fingerprint Scanner |
314+ | DeviceLocked | Authentication was not successful, the device currently in a lockout of 30 seconds |
314315
315316## License
316317
Original file line number Diff line number Diff line change @@ -31,5 +31,5 @@ repositories {
3131
3232dependencies {
3333 compile ' com.facebook.react:react-native:+'
34- compile ' com.wei.android.lib:fingerprintidentify:1.1.4 '
34+ compile ' com.wei.android.lib:fingerprintidentify:1.2.1 '
3535}
Original file line number Diff line number Diff line change @@ -91,10 +91,20 @@ public void onNotMatch(int availableTimes) {
9191 }
9292
9393 @ Override
94- public void onFailed () {
95- promise .reject ("AuthenticationFailed" , "AuthenticationFailed" );
94+ public void onFailed (boolean isDeviceLocked ) {
95+ if (isDeviceLocked ){
96+ promise .reject ("AuthenticationFailed" , "DeviceLocked" );
97+ } else {
98+ promise .reject ("AuthenticationFailed" , "AuthenticationFailed" );
99+ }
96100 ReactNativeFingerprintScannerModule .this .release ();
97101 }
102+
103+ @ Override
104+ public void onStartFailedByDeviceLocked () {
105+ // the first start failed because the device was locked temporarily
106+ promise .reject ("AuthenticationFailed" , "DeviceLocked" );
107+ }
98108 });
99109 }
100110
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ const ERRORS = {
99 FingerprintScannerNotEnrolled : 'Authentication could not start because Fingerprint Scanner has no enrolled fingers.' ,
1010 FingerprintScannerUnknownError : 'Could not authenticate for an unknown reason.' ,
1111 FingerprintScannerNotSupported : 'Device does not support Fingerprint Scanner.' ,
12+ DeviceLocked : 'Authentication was not successful, the device currently in a lockout of 30 seconds'
1213} ;
1314
1415class FingerprintScannerError extends Error {
You can’t perform that action at this time.
0 commit comments