diff --git a/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Common/SalesforceSDKManager.m b/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Common/SalesforceSDKManager.m index 7571c02e94..7463026abe 100644 --- a/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Common/SalesforceSDKManager.m +++ b/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Common/SalesforceSDKManager.m @@ -108,10 +108,6 @@ - (void)viewDidLoad { self.view.backgroundColor = [UIColor salesforceSystemBackgroundColor]; } -- (BOOL)shouldAutorotate { - return YES; -} - - (UIInterfaceOrientationMask)supportedInterfaceOrientations { return UIInterfaceOrientationMaskAll; } diff --git a/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Common/UIDevice+SFHardware.m b/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Common/UIDevice+SFHardware.m index 8134edd124..43552cd41c 100755 --- a/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Common/UIDevice+SFHardware.m +++ b/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Common/UIDevice+SFHardware.m @@ -436,7 +436,12 @@ - (UIInterfaceOrientation)sfsdk_interfaceOrientation { UIDeviceOrientation deviceOrientation = UIDevice.currentDevice.orientation; UIInterfaceOrientation orientation = (UIInterfaceOrientation)deviceOrientation; if (!UIDeviceOrientationIsValidInterfaceOrientation(deviceOrientation)) { - orientation = [SFApplicationHelper sharedApplication].windows.firstObject.windowScene.interfaceOrientation; + UIWindowScene *windowScene = (UIWindowScene *)[[[SFApplicationHelper sharedApplication] connectedScenes] anyObject]; + if ([windowScene isKindOfClass:[UIWindowScene class]]) { + orientation = windowScene.interfaceOrientation; + } else { + orientation = UIInterfaceOrientationUnknown; + } } return orientation; } diff --git a/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Login/SFLoginViewController.m b/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Login/SFLoginViewController.m index b6a9c122fd..bf82c05741 100644 --- a/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Login/SFLoginViewController.m +++ b/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Login/SFLoginViewController.m @@ -288,10 +288,6 @@ - (SFSDKLoginHostListViewController *)createLoginHostListViewController { return loginHostListViewController; } -- (BOOL)shouldAutorotate { - return YES; -} - - (UIInterfaceOrientationMask)supportedInterfaceOrientations { return UIInterfaceOrientationMaskAll; } diff --git a/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/OAuth/SFOAuthCredentials.m b/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/OAuth/SFOAuthCredentials.m index b9c2ee1650..c6f38848bc 100644 --- a/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/OAuth/SFOAuthCredentials.m +++ b/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/OAuth/SFOAuthCredentials.m @@ -44,7 +44,7 @@ static NSString * const kSFOAuthDefaultDomain = @"login.salesforce.com"; static NSString * const kSFOAuthClusterImplementationKey = @"SFOAuthClusterImplementation"; -NSException * SFOAuthInvalidIdentifierException() { +NSException * SFOAuthInvalidIdentifierException(void) { return [[NSException alloc] initWithName:NSInternalInconsistencyException reason:@"identifier cannot be nil or empty" userInfo:nil]; diff --git a/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Storage/KeyValueEncryptedFileStoreInspector.swift b/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Storage/KeyValueEncryptedFileStoreInspector.swift index 927e998e43..7aa87bb206 100644 --- a/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Storage/KeyValueEncryptedFileStoreInspector.swift +++ b/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Storage/KeyValueEncryptedFileStoreInspector.swift @@ -41,8 +41,8 @@ struct KeyValueEncryptedFileStoreInspector: View { VStack(alignment: .leading) { Form { Picker(selection: $selectedIndex, label: Text("Store")) { - ForEach(0 ..< stores.count) { - Text(self.stores[$0]) + ForEach(stores.indices, id: \.self) { index in + Text(self.stores[index]) } } HStack { diff --git a/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Test/SFSDKTestRequestListener.m b/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Test/SFSDKTestRequestListener.m index e29610fba9..34641293ab 100644 --- a/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Test/SFSDKTestRequestListener.m +++ b/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Test/SFSDKTestRequestListener.m @@ -115,6 +115,10 @@ - (void)oauthCoordinatorDidCancelBrowserAuthentication:(SFOAuthCoordinator *)coo NSAssert(NO, @"Web Server flow not supported in this class."); } +- (void)oauthCoordinatorDidBeginNativeAuthentication:(nonnull SFOAuthCoordinator *)coordinator { + NSAssert(NO, @"Web Server flow not supported in this class."); +} + - (void)oauthCoordinatorDidAuthenticate:(SFOAuthCoordinator *)coordinator authInfo:(SFOAuthInfo *)info { [SFSDKCoreLogger i:[self class] format:@"%@ with authInfo: %@", NSStringFromSelector(_cmd), info]; diff --git a/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/UserAccount/SFUserAccount.m b/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/UserAccount/SFUserAccount.m index 67fc5d4865..bfa5f3cc46 100644 --- a/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/UserAccount/SFUserAccount.m +++ b/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/UserAccount/SFUserAccount.m @@ -341,7 +341,7 @@ + (NSString *)loginStateDescriptionFromLoginState:(SFUserAccountLoginState)login } } -NSString *SFKeyForGlobalScope() { +NSString *SFKeyForGlobalScope(void) { return SFKeyForUserIdAndScope(nil,nil,nil,SFUserAccountScopeGlobal); } diff --git a/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Views/SFSDKDevInfoViewController.m b/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Views/SFSDKDevInfoViewController.m index a5be3044f2..7e1bc42c19 100644 --- a/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Views/SFSDKDevInfoViewController.m +++ b/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Views/SFSDKDevInfoViewController.m @@ -139,10 +139,6 @@ - (void)layoutSubviews [self layoutTableView]; } -- (BOOL)shouldAutorotate { - return YES; -} - - (UIInterfaceOrientationMask)supportedInterfaceOrientations { return UIInterfaceOrientationMaskAll; } diff --git a/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Views/SFSDKNavigationController.m b/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Views/SFSDKNavigationController.m index cf850f26b2..cf8bd9df15 100644 --- a/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Views/SFSDKNavigationController.m +++ b/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Views/SFSDKNavigationController.m @@ -38,10 +38,6 @@ - (void)viewDidAppear:(BOOL)animated { [SFSDKViewController refreshAllViews:self.view]; } -- (BOOL)shouldAutorotate{ - return self.topViewController.shouldAutorotate; -} - - (UIInterfaceOrientationMask)supportedInterfaceOrientations { return self.topViewController.supportedInterfaceOrientations; } diff --git a/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Views/SFSDKRootController.m b/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Views/SFSDKRootController.m index 81761b668c..e31c277b23 100644 --- a/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Views/SFSDKRootController.m +++ b/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Views/SFSDKRootController.m @@ -71,14 +71,6 @@ -(UIViewController *)childViewControllerForStatusBarHidden { return nil; } --(BOOL)shouldAutorotate -{ - UIViewController *topViewController = [SFSDKRootController topViewController:self]; - if (topViewController!=nil && topViewController!=self) - return [topViewController shouldAutorotate]; - return NO; -} - - (UIInterfaceOrientationMask)supportedInterfaceOrientations { UIViewController *topViewController = [SFSDKRootController topViewController:self]; diff --git a/libs/SalesforceSDKCore/SalesforceSDKCoreTests/SFOAuthTestFlowCoordinatorDelegate.m b/libs/SalesforceSDKCore/SalesforceSDKCoreTests/SFOAuthTestFlowCoordinatorDelegate.m index 2a597d1fd0..33f57719c2 100644 --- a/libs/SalesforceSDKCore/SalesforceSDKCoreTests/SFOAuthTestFlowCoordinatorDelegate.m +++ b/libs/SalesforceSDKCore/SalesforceSDKCoreTests/SFOAuthTestFlowCoordinatorDelegate.m @@ -101,4 +101,10 @@ - (void)oauthCoordinatorDidCancelBrowserAuthentication:(SFOAuthCoordinator *)coo @throw [NSException exceptionWithName:kASWebAuthenticationSessionNotSupportedReasonFormat reason:reason userInfo:nil]; } +- (void)oauthCoordinatorDidBeginNativeAuthentication:(nonnull SFOAuthCoordinator *)coordinator { + [SFLogger log:[self class] level:SFLogLevelDebug format:@"%@ called.", NSStringFromSelector(_cmd)]; + NSString *reason = [NSString stringWithFormat:kASWebAuthenticationSessionNotSupportedReasonFormat, NSStringFromSelector(_cmd)]; + @throw [NSException exceptionWithName:kASWebAuthenticationSessionNotSupportedReasonFormat reason:reason userInfo:nil]; +} + @end diff --git a/libs/SalesforceSDKCore/SalesforceSDKCoreTests/SFSDKWindowManagerTests.m b/libs/SalesforceSDKCore/SalesforceSDKCoreTests/SFSDKWindowManagerTests.m index d49356f820..b4e0ed6c86 100644 --- a/libs/SalesforceSDKCore/SalesforceSDKCoreTests/SFSDKWindowManagerTests.m +++ b/libs/SalesforceSDKCore/SalesforceSDKCoreTests/SFSDKWindowManagerTests.m @@ -90,7 +90,10 @@ @implementation SFSDKWindowManagerTests - (void)setUp { [super setUp]; - _origApplicationWindow = [UIApplication sharedApplication].keyWindow; + UIWindowScene *windowScene = (UIWindowScene *)[[[UIApplication sharedApplication] connectedScenes] anyObject]; + if ([windowScene isKindOfClass:[UIWindowScene class]]) { + _origApplicationWindow = windowScene.windows.firstObject; + } } - (void)tearDown { diff --git a/libs/SalesforceSDKCore/SalesforceSDKCoreTests/SalesforceOAuthUnitTestsCoordinatorDelegate.m b/libs/SalesforceSDKCore/SalesforceSDKCoreTests/SalesforceOAuthUnitTestsCoordinatorDelegate.m index 0c15d4752d..c7d0cf7fe6 100644 --- a/libs/SalesforceSDKCore/SalesforceSDKCoreTests/SalesforceOAuthUnitTestsCoordinatorDelegate.m +++ b/libs/SalesforceSDKCore/SalesforceSDKCoreTests/SalesforceOAuthUnitTestsCoordinatorDelegate.m @@ -50,4 +50,8 @@ - (void)oauthCoordinatorDidCancelBrowserAuthentication:(SFOAuthCoordinator *)coo XCTFail(@"ASWebAuthenticationSession auth flow is not supported in unit test framework"); } +- (void)oauthCoordinatorDidBeginNativeAuthentication:(nonnull SFOAuthCoordinator *)coordinator { + // ASWebAuthenticationSession auth flow is not supported in unit test framework. + XCTFail(@"ASWebAuthenticationSession auth flow is not supported in unit test framework"); +} @end diff --git a/libs/SalesforceSDKCore/SalesforceSDKCoreTests/SalesforceRestAPITests.m b/libs/SalesforceSDKCore/SalesforceSDKCoreTests/SalesforceRestAPITests.m index 63d3b7ad39..f014c6f85e 100644 --- a/libs/SalesforceSDKCore/SalesforceSDKCoreTests/SalesforceRestAPITests.m +++ b/libs/SalesforceSDKCore/SalesforceSDKCoreTests/SalesforceRestAPITests.m @@ -1247,7 +1247,7 @@ - (void) testParsePrimingRecordsResponseFromServer { SFNativeRestRequestListener *listener = [self sendSyncRequest:request]; NSDictionary* response = listener.dataResponse; @try { - SFSDKPrimingRecordsResponse* parsedResponse = [[SFSDKPrimingRecordsResponse alloc] initWith:response]; + (void)[[SFSDKPrimingRecordsResponse alloc] initWith:response]; } @catch (NSException *exception) { XCTFail(@"Unexpected error %@", exception); diff --git a/libs/SalesforceSDKCore/SalesforceSDKCoreTests/ScreenLockManagerTests.m b/libs/SalesforceSDKCore/SalesforceSDKCoreTests/ScreenLockManagerTests.m index 80dac16464..93f27e4929 100644 --- a/libs/SalesforceSDKCore/SalesforceSDKCoreTests/ScreenLockManagerTests.m +++ b/libs/SalesforceSDKCore/SalesforceSDKCoreTests/ScreenLockManagerTests.m @@ -39,7 +39,7 @@ @interface ScreenLockManagerTests : XCTestCase @implementation ScreenLockManagerTests - (void)setUp { - BOOL _ = [SFSDKKeychainHelper removeAll]; + (void)[SFSDKKeychainHelper removeAll]; } - (void)testShouldNotLock { diff --git a/libs/SmartStore/SmartStore/Classes/SFSmartStoreInspectorViewController.m b/libs/SmartStore/SmartStore/Classes/SFSmartStoreInspectorViewController.m index 636fd11feb..5d25ed89dd 100644 --- a/libs/SmartStore/SmartStore/Classes/SFSmartStoreInspectorViewController.m +++ b/libs/SmartStore/SmartStore/Classes/SFSmartStoreInspectorViewController.m @@ -451,10 +451,6 @@ - (void)layoutSubviews [self.resultGrid reloadData]; } -- (BOOL)shouldAutorotate { - return YES; -} - - (UIInterfaceOrientationMask)supportedInterfaceOrientations { return UIInterfaceOrientationMaskAll; } diff --git a/native/SampleApps/MobileSyncExplorer/MobileSyncExplorer/Classes/ActionsPopupController.m b/native/SampleApps/MobileSyncExplorer/MobileSyncExplorer/Classes/ActionsPopupController.m index 4c1e1c46ac..8077f35268 100644 --- a/native/SampleApps/MobileSyncExplorer/MobileSyncExplorer/Classes/ActionsPopupController.m +++ b/native/SampleApps/MobileSyncExplorer/MobileSyncExplorer/Classes/ActionsPopupController.m @@ -47,11 +47,6 @@ - (id)initWithAppViewController:(ContactListViewController *)appViewController { #pragma mark - View lifecycle --(BOOL)shouldAutorotate -{ - return NO; -} - - (UIInterfaceOrientationMask)supportedInterfaceOrientations { return UIInterfaceOrientationMaskAll;