forcedotcom / SalesforceMobileSDK-iOS-Specs

BSD 3-Clause "New" or "Revised" License
3 stars 20 forks source link

Unable to open SalesForceSDK Login screen After Logging out Using MobileSync pod. #34

Closed SreekanthGudisi closed 3 years ago

SreekanthGudisi commented 3 years ago

Hi all,

We have to upgrade the old SalesForceSDK into the new SalesForceSDK. So I'm using the new MobileSync pod file in my app. Below you could see my podfiles.

Note:- I'm only using pod 'MobileSync'

Uncomment the next line to define a global
platform for your project platform :ios, '13.0' target 'MyApp' do

   # Comment the next line if you don't want to use dynamic frameworks

   source 'https://github.com/forcedotcom/SalesforceMobileSDK-iOS-Specs.git'
   source 'https://github.com/CocoaPods/Specs.git'

   use_frameworks!

   # Pods for MyApp

   pod 'MobileSync'
end

Once I log out from SalesForceSDK, Again I'll have to open the SalesForceSDK Login screen. But Unable to open the SalesForceSDK Login screen After Logging out. Here giving my console details.

2021-07-11 00:04:33.710350+0530 MyApp[69622:3035323][SalesforceSDKCore] CLASS: SFUserAccountManager Logging out user 'xxxxxxx@gmail.com'.

2021-07-11 00:04:33.725606+0530 MyApp[69622:3035323][SalesforceSDKCore] CLASS: SFOAuthKeychainCredentials SFOAuthKeychainCredentials:revokeAccessToken: access token revoked

2021-07-11 00:04:33.737526+0530 MyApp[69622:3035323][SalesforceSDKCore] CLASS: SFOAuthKeychainCredentials SFOAuthKeychainCredentials:revokeRefreshToken: refresh token revoked. Cleared identityUrl, instanceUrl, issuedAt fields

2021-07-11 00:04:33.739295+0530 MyApp[69622:3035323] [SalesforceSDKCore] CLASS: SFOAuthKeychainCredentials SFOAuthKeychainCredentials:setIdentityUrl: invalid or nil identityUrl: (null)

2021-07-11 00:04:33.746165+0530 MyApp[69622:3035323][SalesforceSDKCore] CLASS: SFOAuthKeychainCredentials SFOAuthKeychainCredentials:setIdentityUrl: invalid or nil identityUrl: (null)

2021-07-11 00:04:33.754607+0530 MyApp[69622:3035323] [SalesforceSDKCore] CLASS: SFSecurityLockout Resetting passcode.

2021-07-11 00:04:33.755609+0530 MyApp[69622:3035323][SalesforceSDKCore] CLASS: SFSDKWebViewStateManager [SFSDKWebViewStateManager setSharedProcessPool:]: changing from process pool <WKProcessPool: 0x7fb7b1c59cf0; configuration = <_WKProcessPoolConfiguration: 0x600003064840>> to (null)

2021-07-11 00:04:33.759697+0530 MyApp[69622:3035323] [SalesforceSDKCore] CLASS: SFSecurityLockout App requested passcode screen cancel. Screen is not displayed.

2021-07-11 00:04:33.824328+0530 MyApp[69622:3035323] [SalesforceSDKCore] CLASS: SFOAuthCoordinator authenticate authenticating as 3MXXXXXXXXXXXXXXXXXX.XXXXXXXXXXXXXXXXXX without refresh token on 'https://XXXXXXXXXXXXXXXXXX-retail.XXXXXX.force.com/MyApp ...

2021-07-11 00:04:33.830049+0530 MyApp[69622:3035323] [SalesforceSDKCore] CLASS: SFSDKAuthConfigUtil getMyDomainAuthConfig:loginDomain: Advanced authentication configured. Retrieving auth configuration from https://XXXXXXXXXXXXXXXXXX-retail.XXXXXX.force.com/MyApp/.well-known/auth-configuration

2021-07-11 00:04:34.421281+0530 MyApp[69622:3036404] [SalesforceSDKCore] CLASS: SFSDKAuthConfigUtil Successfully retrieved org auth config data from https://XXXXXXXXXXXXXXXXXX-retail.XXXXXX.force.com/MyApp/.well-known/auth-configuration

2021-07-11 00:04:34.422353+0530 MyApp[69622:3035323] [SalesforceSDKCore] CLASS: SFOAuthCoordinator loadWebViewWithUrlString:cookie: Loadi https://XXXXXXXXXXXXXXXXXX-retail.XXXXXX.force.com/MyApp/services/oauth2/authorize?client_id=3MXXXXXXXXXXXXXXXXXX.XXXXXXXXXXXXXXXXXX&redirect_uri=testsfdc:///mobilesdk/detect/oauth/done&display=touch&device_id=8C9D7D45-06DF-4081-B47E-XXXXXXXXXXXX&response_type=hybrid_token&scope=web%20api%20refresh_token

2021-07-11 00:04:34.422603+0530 MyApp[69622:3035323] [SalesforceSDKCore] CLASS: SFSDKWebViewStateManager [SFSDKWebViewStateManager sharedProcessPool]: No process pool exists. Creating new instance.

2021-07-11 00:04:34.430200+0530 MyApp[69622:3035323] WF: _userSettingsForUser : (null)

2021-07-11 00:04:34.430350+0530 MyApp[69622:3035323] WF: _WebFilterIsActive returning: NO

2021-07-11 00:04:34.596787+0530 MyApp[69622:3035323] [SalesforceSDKCore] CLASS: SFOAuthCoordinator webView:didStartProvisionalNavigation: host=XXXXXXXXXXXXXXXXXX-retail.XXXXXX.force.com : path=/MyApp/services/oauth2/authorize

2021-07-11 00:04:35.461155+0530 MyApp[69622:3035323] Unbalanced calls to begin/end appearance transitions for <SFSDKRootController: 0x7fb7b1c682d0>.

2021-07-11 00:04:35.462132+0530 MyApp[69622:3035323][SalesforceSDKCore] CLASS: SFOAuthCoordinator webView:didStartProvisionalNavigation: host=XXXXXXXXXXXXXXXXXX-retail.XXXXXX.force.com : path=/MyApp/login

2021-07-11 00:04:48.047567+0530 MyApp[69622:3035323] Could not signal service com.apple.WebKit.WebContent: 113: Could not find specified service

But if I use old SalesForceSDK, I can able to do login and log out many times. Below are my old pods.

Uncomment the next line to define a global
platform for your project platform :ios, '10.0' target 'MyApp' do

target 'MyApp' do
  use_frameworks!
   # Pods for SalesForceSDK
   pod 'SalesforceAnalytics', :path => 'mobilesdk/SalesforceMobileSDK-iOS'
   pod 'SalesforceSDKCore', :path => 'mobilesdk/SalesforceMobileSDK-iOS'
   pod 'SmartStore', :path => 'mobilesdk/SalesforceMobileSDK-iOS'
   pod 'SmartSync', :path => 'mobilesdk/SalesforceMobileSDK-iOS'
   pod 'SalesforceSwiftSDK', :path => 'mobilesdk/SalesforceMobileSDK-iOS'
   pod 'PromiseKit', :git => 'https://github.com/mxcl/PromiseKit', :tag => '5.0.3'
end

Any help is more valuable. Thanks in advance 😊

wmathurin commented 3 years ago

Please use forceios to create a brand new app then compare the code in the generated app (app delegate, scene delegate) with yours.

wmathurin commented 3 years ago

Please check out the documentation on how to upgrade the mobile sdk: https://developer.salesforce.com/docs/atlas.en-us.mobile_sdk.meta/mobile_sdk/migration_migrating_from_previous.htm