Skip to content

Commit

Permalink
Remove LocalAuthentication import on tvOS
Browse files Browse the repository at this point in the history
Fixes tvOS build issues
  • Loading branch information
gtebbutt committed Nov 22, 2017
1 parent 114d1ba commit 9f56157
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 9f56157

Please sign in to comment.