From f7eb22b5f99193dfa9280c5089316fb01dfd2f82 Mon Sep 17 00:00:00 2001 From: Alexey Savelev Date: Thu, 11 Apr 2019 14:15:45 +0300 Subject: [PATCH] Add modern keys to control keychain access. This keys replace deprecated ones that was specific to TouchID, and allow to use FaceID feature as well (tested on iPhone X device). --- index.d.ts | 2 ++ ios/RNSensitiveInfo/RNSensitiveInfo.m | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/index.d.ts b/index.d.ts index 214146cf..1bfa2b21 100644 --- a/index.d.ts +++ b/index.d.ts @@ -10,6 +10,8 @@ export enum RNSensitiveInfoAccessControlOptions { 'kSecAccessControlTouchIDAny', 'kSecAccessControlTouchIDCurrentSet', 'kSecAccessControlUserPresence', + 'kSecAccessControlBiometryAny', + 'kSecAccessControlBiometryCurrentSet', } export enum RNSensitiveInfoAttrAccessibleOptions { diff --git a/ios/RNSensitiveInfo/RNSensitiveInfo.m b/ios/RNSensitiveInfo/RNSensitiveInfo.m index f30bf18f..f1fa6054 100644 --- a/ios/RNSensitiveInfo/RNSensitiveInfo.m +++ b/ios/RNSensitiveInfo/RNSensitiveInfo.m @@ -34,6 +34,12 @@ CFStringRef convertkSecAttrAccessible(NSString* key){ if([key isEqual: @"kSecAttrAccessibleAlwaysThisDeviceOnly"]){ return kSecAttrAccessibleAlwaysThisDeviceOnly; } + if ([key isEqual: @"kSecAccessControlBiometryAny"]) { + return kSecAccessControlBiometryAny; + } + if ([key isEqual: @"kSecAccessControlBiometryCurrentSet"]) { + return kSecAccessControlBiometryCurrentSet; + } return kSecAttrAccessibleWhenUnlocked; }