Skip to content

Commit

Permalink
Merge pull request #270 from gtebbutt/master
Browse files Browse the repository at this point in the history
Remove LocalAuthentication import on tvOS
  • Loading branch information
GantMan committed Nov 22, 2017
2 parents 114d1ba + 9f56157 commit 098c379
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions RNDeviceInfo/RNDeviceInfo.m
Expand Up @@ -8,7 +8,9 @@

#import "RNDeviceInfo.h"
#import "DeviceUID.h"
#if !(TARGET_OS_TV)
#import <LocalAuthentication/LocalAuthentication.h>
#endif

@interface RNDeviceInfo()
@property (nonatomic) bool isEmulator;
Expand Down Expand Up @@ -220,8 +222,12 @@ - (NSDictionary *)constantsToExport

RCT_EXPORT_METHOD(isPinOrFingerprintSet:(RCTResponseSenderBlock)callback)
{
#if TARGET_OS_TV
BOOL isPinOrFingerprintSet = false;
#else
LAContext *context = [[LAContext alloc] init];
BOOL isPinOrFingerprintSet = ([context canEvaluatePolicy:LAPolicyDeviceOwnerAuthentication error:nil]);
#endif
callback(@[[NSNumber numberWithBool:isPinOrFingerprintSet]]);
}

Expand Down

0 comments on commit 098c379

Please sign in to comment.