Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LAContext invalidated #164

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion ios/ReactNativeFingerprintScanner.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
@implementation ReactNativeFingerprintScanner

RCT_EXPORT_MODULE();
LAContext *context;

RCT_EXPORT_METHOD(isSensorAvailable: (RCTResponseSenderBlock)callback)
{
Expand Down Expand Up @@ -47,7 +48,7 @@ @implementation ReactNativeFingerprintScanner
fallback: (BOOL)fallbackEnabled
callback: (RCTResponseSenderBlock)callback)
{
LAContext *context = [[LAContext alloc] init];
context = [[LAContext alloc] init];
NSError *error;

// Toggle fallback button
Expand Down Expand Up @@ -121,6 +122,10 @@ @implementation ReactNativeFingerprintScanner
}
}

RCT_EXPORT_METHOD(invalidate){
[context invalidate];
}

- (NSString *)getBiometryType:(LAContext *)context
{
if (@available(iOS 11, *)) {
Expand Down
2 changes: 2 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import authenticate from './authenticate';
import isSensorAvailable from './isSensorAvailable';
import release from './release';
import invalidate from './invalidate';

export default {
authenticate,
release,
isSensorAvailable,
invalidate,
};
1 change: 1 addition & 0 deletions src/invalidate.android.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default () => null;
8 changes: 8 additions & 0 deletions src/invalidate.ios.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { NativeModules } from 'react-native';

const { ReactNativeFingerprintScanner } = NativeModules;

export default () => {
return ReactNativeFingerprintScanner.invalidate();
}