From e6fcb9be9abf94663617675688ed705b0131611a Mon Sep 17 00:00:00 2001 From: Takashi Arai Date: Wed, 20 May 2026 13:46:45 -1000 Subject: [PATCH 1/5] Add option to automatically present biometric opt-in and lock --- .../BiometricAuthenticationManager.swift | 5 + ...ometricAuthenticationManagerInternal.swift | 12 +- .../UserAccount/SFUserAccountManager.m | 5 +- .../BiometricAuthenticationManagerTests.swift | 136 +++++++++++++++++- .../URLSessionTask+RetryPolicyTests.swift | 6 +- 5 files changed, 152 insertions(+), 12 deletions(-) diff --git a/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Security/BiometricAuthentication/BiometricAuthenticationManager.swift b/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Security/BiometricAuthentication/BiometricAuthenticationManager.swift index 853c5eda7e..1467837cc2 100644 --- a/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Security/BiometricAuthentication/BiometricAuthenticationManager.swift +++ b/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Security/BiometricAuthentication/BiometricAuthenticationManager.swift @@ -36,6 +36,11 @@ public protocol BiometricAuthenticationManager { /// If the device is currently locked. Authenticated rest requests will fail if true. var locked: Bool { get } + /// If enabled, the SDK will automatically present the biometric opt-in dialog after login + /// (if the user has not yet opted in) and automatically trigger biometric unlock when the + /// app is locked (if the user has opted in). Defaults to false. + var automaticPresentation: Bool { get set } + /// Locks the device immediately. Authenticated rest requests will fail until the user unlocks the app. func lock() diff --git a/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Security/BiometricAuthentication/BiometricAuthenticationManagerInternal.swift b/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Security/BiometricAuthentication/BiometricAuthenticationManagerInternal.swift index 85c06cd02d..1f6119bd39 100644 --- a/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Security/BiometricAuthentication/BiometricAuthenticationManagerInternal.swift +++ b/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Security/BiometricAuthentication/BiometricAuthenticationManagerInternal.swift @@ -45,7 +45,9 @@ public class BiometricAuthenticationManagerInternal: NSObject, BiometricAuthenti } public var locked = false - + + public var automaticPresentation = false + internal var backgroundTimestamp: Double = 0 // This is a local var so it can be stubbed for tests internal var laContext = LAContext() @@ -134,7 +136,7 @@ public class BiometricAuthenticationManagerInternal: NSObject, BiometricAuthenti public func lock() { locked = true NotificationCenter.default.post(name: Notification.Name(rawValue: kSFBiometricAuthenticationFlowWillBegin), object: nil) - + // Open the Login Screen _ = UserAccountManager.shared.login { result in switch result { @@ -146,6 +148,12 @@ public class BiometricAuthenticationManagerInternal: NSObject, BiometricAuthenti SFSDKCoreLogger.e(BiometricAuthenticationManagerInternal.self, message: "Biometric authentication failed: \(error)") } } + + if hasBiometricOptedIn() && automaticPresentation { + SFApplicationHelper.sharedApplication()?.connectedScenes.forEach() { scene in + presentBiometric(scene: scene) + } + } } public func biometricOptIn(optIn: Bool) { diff --git a/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/UserAccount/SFUserAccountManager.m b/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/UserAccount/SFUserAccountManager.m index 8cb0d9b7e3..6ad6b3601a 100644 --- a/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/UserAccount/SFUserAccountManager.m +++ b/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/UserAccount/SFUserAccountManager.m @@ -1971,7 +1971,10 @@ - (void)retrievedIdentityData:(SFSDKAuthSession *)authSession { [SFSDKAppFeatureMarkers registerAppFeature:kSFAppFeatureBioAuth]; [bioAuthManager storePolicyWithUserAccount:self.currentUser hasMobilePolicy:hasBioAuthPolicy sessionTimeout:sessionTimeout]; - + if (![bioAuthManager hasBiometricOptedIn] && bioAuthManager.automaticPresentation) { + [bioAuthManager presentOptInDialogWithViewController:[[SFSDKWindowManager sharedManager] mainWindow:authSession.oauthRequest.scene].topViewController]; + } + if (preLoginCredentials != nil && ![preLoginCredentials.refreshToken isEqualToString:self.currentUser.credentials.refreshToken]) { id authClient = self.authClient(); diff --git a/libs/SalesforceSDKCore/SalesforceSDKCoreTests/BiometricAuthenticationManagerTests.swift b/libs/SalesforceSDKCore/SalesforceSDKCoreTests/BiometricAuthenticationManagerTests.swift index a89ecebaba..ad4ba061dd 100644 --- a/libs/SalesforceSDKCore/SalesforceSDKCoreTests/BiometricAuthenticationManagerTests.swift +++ b/libs/SalesforceSDKCore/SalesforceSDKCoreTests/BiometricAuthenticationManagerTests.swift @@ -39,6 +39,8 @@ final class BiometricAuthenticationManagerTests: XCTestCase { } override func tearDownWithError() throws { + bioAuthManager.automaticPresentation = false + bioAuthManager.locked = false _ = KeychainHelper.removeAll() UserAccountManager.shared.clearAllAccountState() } @@ -176,29 +178,149 @@ final class BiometricAuthenticationManagerTests: XCTestCase { bioAuthManager.storePolicy(userAccount: user, hasMobilePolicy: true, sessionTimeout: 15) XCTAssertTrue(bioAuthManager.checkForPolicy(userId: user.idData.userId)) bioAuthManager.locked = true - + bioAuthManager.cleanup(user: user) XCTAssertFalse(bioAuthManager.checkForPolicy(userId: user.idData.userId)) XCTAssertFalse(bioAuthManager.locked, "Locked status should be reset.") } - - + + // MARK: - automaticPresentation Tests + + func testAutomaticPresentationDefaultsToFalse() { + XCTAssertFalse(bioAuthManager.automaticPresentation, "automaticPresentation should default to false.") + } + + func testAutomaticPresentationLockAutoPresentsWhenOptedIn() { + // Scenario B1: automaticPresentation=true, hasBiometricOptedIn=true, lock triggered + // Expected: presentBiometric called + let user = createUser(index: 0) + bioAuthManager.storePolicy(userAccount: user, hasMobilePolicy: true, sessionTimeout: 1) + bioAuthManager.biometricOptIn(optIn: true) + bioAuthManager.automaticPresentation = true + bioAuthManager.laContext = StubbedLAContext(canEvaluate: true) + + // Set timestamp past timeout to trigger lock + bioAuthManager.backgroundTimestamp = Date().timeIntervalSince1970 - 120 + + // Verify preconditions + XCTAssertTrue(bioAuthManager.hasBiometricOptedIn()) + XCTAssertTrue(bioAuthManager.automaticPresentation) + XCTAssertTrue(bioAuthManager.shouldLock()) + + // The lock() method will call presentBiometric when conditions are met. + // We verify the conditions are correctly evaluated by checking the state. + // (Full UI presentation requires integration test with real scenes.) + bioAuthManager.locked = true + let shouldAutoPresent = bioAuthManager.hasBiometricOptedIn() && bioAuthManager.automaticPresentation + XCTAssertTrue(shouldAutoPresent, "Should auto-present biometric when opted in and automaticPresentation is enabled.") + + // Cleanup + bioAuthManager.automaticPresentation = false + bioAuthManager.locked = false + } + + func testAutomaticPresentationLockDoesNotPresentWhenNotOptedIn() { + // Scenario B2: automaticPresentation=true, hasBiometricOptedIn=false, lock triggered + // Expected: no auto-present + let user = createUser(index: 0) + bioAuthManager.storePolicy(userAccount: user, hasMobilePolicy: true, sessionTimeout: 1) + bioAuthManager.automaticPresentation = true + + XCTAssertFalse(bioAuthManager.hasBiometricOptedIn()) + let shouldAutoPresent = bioAuthManager.hasBiometricOptedIn() && bioAuthManager.automaticPresentation + XCTAssertFalse(shouldAutoPresent, "Should not auto-present biometric when not opted in.") + + // Cleanup + bioAuthManager.automaticPresentation = false + } + + func testAutomaticPresentationDisabledDoesNotPresent() { + // Scenario B3: automaticPresentation=false, hasBiometricOptedIn=true, lock triggered + // Expected: no auto-present + let user = createUser(index: 0) + bioAuthManager.storePolicy(userAccount: user, hasMobilePolicy: true, sessionTimeout: 1) + bioAuthManager.biometricOptIn(optIn: true) + bioAuthManager.automaticPresentation = false + + XCTAssertTrue(bioAuthManager.hasBiometricOptedIn()) + let shouldAutoPresent = bioAuthManager.hasBiometricOptedIn() && bioAuthManager.automaticPresentation + XCTAssertFalse(shouldAutoPresent, "Should not auto-present biometric when automaticPresentation is disabled.") + } + + func testAutomaticPresentationBothDisabled() { + // Scenario B4: automaticPresentation=false, hasBiometricOptedIn=false + // Expected: no auto-present + let user = createUser(index: 0) + bioAuthManager.storePolicy(userAccount: user, hasMobilePolicy: true, sessionTimeout: 1) + bioAuthManager.automaticPresentation = false + + XCTAssertFalse(bioAuthManager.hasBiometricOptedIn()) + XCTAssertFalse(bioAuthManager.automaticPresentation) + let shouldAutoPresent = bioAuthManager.hasBiometricOptedIn() && bioAuthManager.automaticPresentation + XCTAssertFalse(shouldAutoPresent, "Should not auto-present when both conditions are false.") + } + + func testAutomaticPresentationOptInDialogConditions() { + // Scenario A1/A2/A3: Tests the condition for showing opt-in dialog after login + // The condition is: !hasBiometricOptedIn && automaticPresentation + let user = createUser(index: 0) + bioAuthManager.storePolicy(userAccount: user, hasMobilePolicy: true, sessionTimeout: 1) + + // A3: automaticPresentation=false, not opted in -> no dialog + bioAuthManager.automaticPresentation = false + var shouldShowOptIn = !bioAuthManager.hasBiometricOptedIn() && bioAuthManager.automaticPresentation + XCTAssertFalse(shouldShowOptIn, "Should not show opt-in dialog when automaticPresentation is disabled.") + + // A1: automaticPresentation=true, not opted in -> show dialog + bioAuthManager.automaticPresentation = true + shouldShowOptIn = !bioAuthManager.hasBiometricOptedIn() && bioAuthManager.automaticPresentation + XCTAssertTrue(shouldShowOptIn, "Should show opt-in dialog when automaticPresentation is enabled and user has not opted in.") + + // A2: automaticPresentation=true, already opted in -> no dialog + bioAuthManager.biometricOptIn(optIn: true) + shouldShowOptIn = !bioAuthManager.hasBiometricOptedIn() && bioAuthManager.automaticPresentation + XCTAssertFalse(shouldShowOptIn, "Should not show opt-in dialog when user has already opted in.") + + // Cleanup + bioAuthManager.automaticPresentation = false + } + + func testAutomaticPresentationDoesNotAffectExistingLockBehavior() { + // Scenario D1: automaticPresentation=false (default) should not change existing behavior + let user = createUser(index: 0) + bioAuthManager.storePolicy(userAccount: user, hasMobilePolicy: true, sessionTimeout: 1) + bioAuthManager.automaticPresentation = false + + // Set timestamp past timeout + bioAuthManager.backgroundTimestamp = Date().timeIntervalSince1970 - 120 + + // Lock should still trigger normally + XCTAssertTrue(bioAuthManager.shouldLock(), "shouldLock should still work when automaticPresentation is disabled.") + XCTAssertFalse(bioAuthManager.automaticPresentation) + + // After lock, auto-present should NOT fire + let shouldAutoPresent = bioAuthManager.hasBiometricOptedIn() && bioAuthManager.automaticPresentation + XCTAssertFalse(shouldAutoPresent, "Auto-present should not fire when automaticPresentation is off.") + } + + // MARK: - Helpers + private func createUser(index: Int) -> UserAccount { let credentials = OAuthCredentials(identifier: "identifier-\(index)", clientId: "fakeClientIdForTesting", encrypted: true)! let user = UserAccount(credentials: credentials) user.idData = IdentityData(jsonDict: [ "user_id": "\(index)" ]) UserAccountManager.shared.currentUserAccount = user - + return user } - + private class StubbedLAContext: LAContext { let canEvaluate: Bool - + init(canEvaluate: Bool) { self.canEvaluate = canEvaluate } - + override func canEvaluatePolicy(_ policy: LAPolicy, error: NSErrorPointer) -> Bool { return canEvaluate } diff --git a/libs/SalesforceSDKCore/SalesforceSDKCoreTests/URLSessionTask+RetryPolicyTests.swift b/libs/SalesforceSDKCore/SalesforceSDKCoreTests/URLSessionTask+RetryPolicyTests.swift index 0a57da4a2e..030a239e5b 100644 --- a/libs/SalesforceSDKCore/SalesforceSDKCoreTests/URLSessionTask+RetryPolicyTests.swift +++ b/libs/SalesforceSDKCore/SalesforceSDKCoreTests/URLSessionTask+RetryPolicyTests.swift @@ -5,9 +5,11 @@ class URLSessionTaskRetryPolicyTests: XCTestCase { class MockBiometricAuthenticationManager: BiometricAuthenticationManager { var enabled: Bool - + var locked: Bool - + + var automaticPresentation: Bool = false + func lock() { locked = true } From 29d66727ca744a8367e9a69f5747f7d8ecf07731 Mon Sep 17 00:00:00 2001 From: Takashi Arai Date: Wed, 20 May 2026 13:56:11 -1000 Subject: [PATCH 2/5] nit. --- .../BiometricAuthenticationManagerInternal.swift | 2 +- .../BiometricAuthenticationManagerTests.swift | 10 +++++----- .../URLSessionTask+RetryPolicyTests.swift | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Security/BiometricAuthentication/BiometricAuthenticationManagerInternal.swift b/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Security/BiometricAuthentication/BiometricAuthenticationManagerInternal.swift index 1f6119bd39..9a3343c2d6 100644 --- a/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Security/BiometricAuthentication/BiometricAuthenticationManagerInternal.swift +++ b/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Security/BiometricAuthentication/BiometricAuthenticationManagerInternal.swift @@ -136,7 +136,7 @@ public class BiometricAuthenticationManagerInternal: NSObject, BiometricAuthenti public func lock() { locked = true NotificationCenter.default.post(name: Notification.Name(rawValue: kSFBiometricAuthenticationFlowWillBegin), object: nil) - + // Open the Login Screen _ = UserAccountManager.shared.login { result in switch result { diff --git a/libs/SalesforceSDKCore/SalesforceSDKCoreTests/BiometricAuthenticationManagerTests.swift b/libs/SalesforceSDKCore/SalesforceSDKCoreTests/BiometricAuthenticationManagerTests.swift index ad4ba061dd..07c89010b9 100644 --- a/libs/SalesforceSDKCore/SalesforceSDKCoreTests/BiometricAuthenticationManagerTests.swift +++ b/libs/SalesforceSDKCore/SalesforceSDKCoreTests/BiometricAuthenticationManagerTests.swift @@ -178,7 +178,7 @@ final class BiometricAuthenticationManagerTests: XCTestCase { bioAuthManager.storePolicy(userAccount: user, hasMobilePolicy: true, sessionTimeout: 15) XCTAssertTrue(bioAuthManager.checkForPolicy(userId: user.idData.userId)) bioAuthManager.locked = true - + bioAuthManager.cleanup(user: user) XCTAssertFalse(bioAuthManager.checkForPolicy(userId: user.idData.userId)) XCTAssertFalse(bioAuthManager.locked, "Locked status should be reset.") @@ -310,17 +310,17 @@ final class BiometricAuthenticationManagerTests: XCTestCase { let user = UserAccount(credentials: credentials) user.idData = IdentityData(jsonDict: [ "user_id": "\(index)" ]) UserAccountManager.shared.currentUserAccount = user - + return user } - + private class StubbedLAContext: LAContext { let canEvaluate: Bool - + init(canEvaluate: Bool) { self.canEvaluate = canEvaluate } - + override func canEvaluatePolicy(_ policy: LAPolicy, error: NSErrorPointer) -> Bool { return canEvaluate } diff --git a/libs/SalesforceSDKCore/SalesforceSDKCoreTests/URLSessionTask+RetryPolicyTests.swift b/libs/SalesforceSDKCore/SalesforceSDKCoreTests/URLSessionTask+RetryPolicyTests.swift index 030a239e5b..fa562f15d0 100644 --- a/libs/SalesforceSDKCore/SalesforceSDKCoreTests/URLSessionTask+RetryPolicyTests.swift +++ b/libs/SalesforceSDKCore/SalesforceSDKCoreTests/URLSessionTask+RetryPolicyTests.swift @@ -5,7 +5,7 @@ class URLSessionTaskRetryPolicyTests: XCTestCase { class MockBiometricAuthenticationManager: BiometricAuthenticationManager { var enabled: Bool - + var locked: Bool var automaticPresentation: Bool = false From dcbdc219d91e81f232a7896e553226df68fd6da5 Mon Sep 17 00:00:00 2001 From: Takashi Arai Date: Wed, 20 May 2026 14:39:21 -1000 Subject: [PATCH 3/5] cover automaticPresentation branch in lock() via handleAppForeground() --- .../BiometricAuthenticationManagerTests.swift | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libs/SalesforceSDKCore/SalesforceSDKCoreTests/BiometricAuthenticationManagerTests.swift b/libs/SalesforceSDKCore/SalesforceSDKCoreTests/BiometricAuthenticationManagerTests.swift index 07c89010b9..81227f8c5c 100644 --- a/libs/SalesforceSDKCore/SalesforceSDKCoreTests/BiometricAuthenticationManagerTests.swift +++ b/libs/SalesforceSDKCore/SalesforceSDKCoreTests/BiometricAuthenticationManagerTests.swift @@ -192,7 +192,7 @@ final class BiometricAuthenticationManagerTests: XCTestCase { func testAutomaticPresentationLockAutoPresentsWhenOptedIn() { // Scenario B1: automaticPresentation=true, hasBiometricOptedIn=true, lock triggered - // Expected: presentBiometric called + // Expected: lock() enters the auto-present branch (presentBiometric called for each scene) let user = createUser(index: 0) bioAuthManager.storePolicy(userAccount: user, hasMobilePolicy: true, sessionTimeout: 1) bioAuthManager.biometricOptIn(optIn: true) @@ -207,12 +207,12 @@ final class BiometricAuthenticationManagerTests: XCTestCase { XCTAssertTrue(bioAuthManager.automaticPresentation) XCTAssertTrue(bioAuthManager.shouldLock()) - // The lock() method will call presentBiometric when conditions are met. - // We verify the conditions are correctly evaluated by checking the state. - // (Full UI presentation requires integration test with real scenes.) - bioAuthManager.locked = true - let shouldAutoPresent = bioAuthManager.hasBiometricOptedIn() && bioAuthManager.automaticPresentation - XCTAssertTrue(shouldAutoPresent, "Should auto-present biometric when opted in and automaticPresentation is enabled.") + // Trigger the full lock flow via handleAppForeground(). + // This calls lock() which exercises the automaticPresentation branch. + // presentBiometric(scene:) is a no-op in test (no connected scenes / LAContext + // cannot evaluate in unit test sandbox), but the code path is exercised. + bioAuthManager.handleAppForeground() + XCTAssertTrue(bioAuthManager.locked, "App should be locked after timeout.") // Cleanup bioAuthManager.automaticPresentation = false From 0b7ee5d1eb4ba8eb31c1ee5883ca360f63426d47 Mon Sep 17 00:00:00 2001 From: Takashi Arai Date: Thu, 21 May 2026 07:52:41 -1000 Subject: [PATCH 4/5] fix test. --- .../BiometricAuthenticationManagerTests.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libs/SalesforceSDKCore/SalesforceSDKCoreTests/BiometricAuthenticationManagerTests.swift b/libs/SalesforceSDKCore/SalesforceSDKCoreTests/BiometricAuthenticationManagerTests.swift index 81227f8c5c..d34b6ebe20 100644 --- a/libs/SalesforceSDKCore/SalesforceSDKCoreTests/BiometricAuthenticationManagerTests.swift +++ b/libs/SalesforceSDKCore/SalesforceSDKCoreTests/BiometricAuthenticationManagerTests.swift @@ -167,6 +167,8 @@ final class BiometricAuthenticationManagerTests: XCTestCase { XCTAssertFalse(bioAuthManager.showNativeLoginButton(), "Button should show until user opts in.") bioAuthManager.biometricOptIn(optIn: true) + // showNativeLoginButton() requires hasPolicy && locked && hasBiometricOptedIn + bioAuthManager.locked = true XCTAssertTrue(bioAuthManager.showNativeLoginButton()) bioAuthManager.enableNativeBiometricLoginButton(enabled: false) From 00153e34136e028eae5f8c0974766521723236b4 Mon Sep 17 00:00:00 2001 From: Takashi Arai Date: Tue, 26 May 2026 12:06:56 -1000 Subject: [PATCH 5/5] default to true. --- .../BiometricAuthenticationManager.swift | 2 +- .../BiometricAuthenticationManagerInternal.swift | 2 +- .../BiometricAuthenticationManagerTests.swift | 6 +++--- .../URLSessionTask+RetryPolicyTests.swift | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Security/BiometricAuthentication/BiometricAuthenticationManager.swift b/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Security/BiometricAuthentication/BiometricAuthenticationManager.swift index 1467837cc2..94adb24268 100644 --- a/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Security/BiometricAuthentication/BiometricAuthenticationManager.swift +++ b/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Security/BiometricAuthentication/BiometricAuthenticationManager.swift @@ -38,7 +38,7 @@ public protocol BiometricAuthenticationManager { /// If enabled, the SDK will automatically present the biometric opt-in dialog after login /// (if the user has not yet opted in) and automatically trigger biometric unlock when the - /// app is locked (if the user has opted in). Defaults to false. + /// app is locked (if the user has opted in). Defaults to true. var automaticPresentation: Bool { get set } /// Locks the device immediately. Authenticated rest requests will fail until the user unlocks the app. diff --git a/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Security/BiometricAuthentication/BiometricAuthenticationManagerInternal.swift b/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Security/BiometricAuthentication/BiometricAuthenticationManagerInternal.swift index 9a3343c2d6..8506c1b0f6 100644 --- a/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Security/BiometricAuthentication/BiometricAuthenticationManagerInternal.swift +++ b/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Security/BiometricAuthentication/BiometricAuthenticationManagerInternal.swift @@ -46,7 +46,7 @@ public class BiometricAuthenticationManagerInternal: NSObject, BiometricAuthenti public var locked = false - public var automaticPresentation = false + public var automaticPresentation = true internal var backgroundTimestamp: Double = 0 // This is a local var so it can be stubbed for tests diff --git a/libs/SalesforceSDKCore/SalesforceSDKCoreTests/BiometricAuthenticationManagerTests.swift b/libs/SalesforceSDKCore/SalesforceSDKCoreTests/BiometricAuthenticationManagerTests.swift index d34b6ebe20..7dd3a7c5e0 100644 --- a/libs/SalesforceSDKCore/SalesforceSDKCoreTests/BiometricAuthenticationManagerTests.swift +++ b/libs/SalesforceSDKCore/SalesforceSDKCoreTests/BiometricAuthenticationManagerTests.swift @@ -39,7 +39,7 @@ final class BiometricAuthenticationManagerTests: XCTestCase { } override func tearDownWithError() throws { - bioAuthManager.automaticPresentation = false + bioAuthManager.automaticPresentation = true bioAuthManager.locked = false _ = KeychainHelper.removeAll() UserAccountManager.shared.clearAllAccountState() @@ -188,8 +188,8 @@ final class BiometricAuthenticationManagerTests: XCTestCase { // MARK: - automaticPresentation Tests - func testAutomaticPresentationDefaultsToFalse() { - XCTAssertFalse(bioAuthManager.automaticPresentation, "automaticPresentation should default to false.") + func testAutomaticPresentationDefaultsToTrue() { + XCTAssertTrue(bioAuthManager.automaticPresentation, "automaticPresentation should default to true.") } func testAutomaticPresentationLockAutoPresentsWhenOptedIn() { diff --git a/libs/SalesforceSDKCore/SalesforceSDKCoreTests/URLSessionTask+RetryPolicyTests.swift b/libs/SalesforceSDKCore/SalesforceSDKCoreTests/URLSessionTask+RetryPolicyTests.swift index fa562f15d0..7c9d5054bd 100644 --- a/libs/SalesforceSDKCore/SalesforceSDKCoreTests/URLSessionTask+RetryPolicyTests.swift +++ b/libs/SalesforceSDKCore/SalesforceSDKCoreTests/URLSessionTask+RetryPolicyTests.swift @@ -8,7 +8,7 @@ class URLSessionTaskRetryPolicyTests: XCTestCase { var locked: Bool - var automaticPresentation: Bool = false + var automaticPresentation: Bool = true func lock() { locked = true