Commit 720fe01d authored by Kacyn Fujii's avatar Kacyn Fujii

make security info a callback

parent cf5075db
...@@ -163,12 +163,6 @@ RCT_EXPORT_MODULE() ...@@ -163,12 +163,6 @@ RCT_EXPORT_MODULE()
return [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad; return [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad;
} }
- (bool) isPinOrFingerprintSet
{
LAContext *context = [[LAContext alloc] init];
return ([context canEvaluatePolicy:LAPolicyDeviceOwnerAuthentication error:nil]);
}
- (NSDictionary *)constantsToExport - (NSDictionary *)constantsToExport
{ {
UIDevice *currentDevice = [UIDevice currentDevice]; UIDevice *currentDevice = [UIDevice currentDevice];
...@@ -193,8 +187,16 @@ RCT_EXPORT_MODULE() ...@@ -193,8 +187,16 @@ RCT_EXPORT_MODULE()
@"timezone": self.timezone, @"timezone": self.timezone,
@"isEmulator": @(self.isEmulator), @"isEmulator": @(self.isEmulator),
@"isTablet": @(self.isTablet), @"isTablet": @(self.isTablet),
@"isPinOrFingerprintSet": @(self.isPinOrFingerprintSet),
}; };
} }
RCT_EXPORT_METHOD(isPinOrFingerprintSet:(RCTResponseSenderBlock)callback)
{
LAContext *context = [[LAContext alloc] init];
BOOL b = ([context canEvaluatePolicy:LAPolicyDeviceOwnerAuthentication error:nil]);
NSMutableArray *array = [[NSMutableArray alloc] init];
[array addObject:[NSNumber numberWithBool:b]];
callback(@[array]);
}
@end @end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment