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

[iOS][Android] Add LocalAnthentication#supportedAuthenticationTypes #2450

Merged
merged 1 commit into from Oct 23, 2018

Conversation

bbarthec
Copy link
Contributor

@bbarthec bbarthec commented Oct 18, 2018

Why

Resolves #2447

Additionally I removed react-native-svg from ncl that was causing ncl to crash. (this package is dependency of expo not ncl)

How

iOS -> used method that was available for FaceID and added similar for TouchID.
Android -> used method responsible for checking for Fingerprint API.

Test Plan

ncl#LocalAuthenticationScreen has new button invoking this method.

@bbarthec bbarthec requested a review from tsapeta October 18, 2018 09:27
@bbarthec bbarthec force-pushed the @bbarthec/provide-authentication-type branch from 130ca69 to 013dca9 Compare October 18, 2018 10:50
@tsapeta tsapeta changed the title [iOS][Android] Add LocalAnthentication#supportedAuntehnticationTypes [iOS][Android] Add LocalAnthentication#supportedAuthenticationTypes Oct 18, 2018
throw new Error(`Unrecognised authentitcation type returned: '${type}'`);
}
return acc ? `${acc}, ${typeName}` : typeName;
}, '');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be better to use result.map(() => {...}).join(', ') :)

typeName = 'FACIAL_RECOGNITION';
break;
default:
throw new Error(`Unrecognised authentitcation type returned: '${type}'`);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

authentitcation -> authentication

static BOOL EXIsTouchIDDevice()
{
static BOOL isTouchIDDevice = NO;
if (@available(iOS 11.0, *)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@available shouldn't be there or at least not with iOS 11.0, because TouchID is available in iOS 10.0 too

@@ -6,6 +6,11 @@
#import <EXConstantsInterface/EXConstantsInterface.h>
#import <EXLocalAuthentication/EXLocalAuthentication.h>

typedef NS_ENUM(NSInteger, EXAuthenticationType) {
EXAuthenticationTypeFingerprint = 1,
EXAuthenticationTypeFacialRecogniotion = 2,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EXAuthenticationTypeFacialRecogniotion

@bbarthec bbarthec force-pushed the @bbarthec/provide-authentication-type branch from 013dca9 to 81b83af Compare October 18, 2018 11:39
@tsapeta tsapeta merged commit 16cda43 into master Oct 23, 2018
@tsapeta tsapeta deleted the @bbarthec/provide-authentication-type branch October 23, 2018 14:14
@tsapeta tsapeta removed the in review label Oct 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants