Skip to content

Commit

Permalink
Work around a simulator issue related to biometric
Browse files Browse the repository at this point in the history
  • Loading branch information
louischan-oursky committed Jan 17, 2024
1 parent c23f468 commit ec561c5
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,10 @@ import Capacitor
// https://developer.apple.com/documentation/security/certificate_key_and_trust_services/keys/protecting_keys_with_the_secure_enclave
flags.insert(.privateKeyUsage)

#if targetEnvironment(simulator)
// On Xcode 15.2, iPhone 15 iOS 17.2, using any of these flags will result in
// NSOSStatusErrorDomain code=-25293 message="Key generation failed"
#else
switch constraint {
case "biometryAny":
flags.insert(.biometryAny)
Expand All @@ -360,6 +364,7 @@ import Capacitor
default:
break
}
#endif

guard let accessControl = SecAccessControlCreateWithFlags(
kCFAllocatorDefault,
Expand Down

0 comments on commit ec561c5

Please sign in to comment.