We are facing a problem on IOS(iPad OS) devices when authorized users are logged out from applications when they hide applications in background mode. This problem appears after we had updated Mobile SDK from the 8.3 to the 9.1.1 version. So if we have any background processes, such as asking Salesforce about Auth Credentials for background sync or fetch local notifications - application keychain access to the database lost.

And here is an errors from log:

[SalesforceSDKCore] CLASS: SFCrypto Could not save the base app identifier to the keychain (result: (null)).  Retrying.

[SalesforceSDKCore] CLASS: SFCrypto Could not persist the base app identifier.  Returning in-memory value.

[SalesforceSDKCore] CLASS: SFGeneratedKeyStore Error saving key com.salesforce.keystore.generatedKeystoreKeychainId_*[SOME_ID]* store to the keychain.

[SalesforceSDKCore] CLASS: SFOAuthKeychainCredentials Could not read com.salesforce.oauth.refresh from keychain, Error Domain=com.salesforce.security.keychainException Code=-25308 "User interaction is not allowed." UserInfo={NSLocalizedDescription=User interaction is not allowed., com.salesforce.security.keychainException.errorCode=-25308}

 *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]' 

enter image description here

Issue is being reproduced only on physical devices, not simulator for Hybrid (Cordova) and IOS application

This problem is very urgent and critical, because with logout - users lost their databases, which contain a lot of local data for a long time.

For sure, we have reports about such logout in the 8.3 version, but it wasn't clearly expressed and can't be reproduced by our powers.

  • seems we are facing the same issue. Please let me know if you find any workaround.
    – MiGro
    Commented Nov 18, 2021 at 8:25
  • @MiGro, the only way to stop logout, that we found - turn off background mode or find the places where the application does some work in the background and limit them locally to work when the application is focused. You can try it. Unfortunately, we cannot use it. Commented Nov 18, 2021 at 8:48
  • Understood. Please have a look here: githubmemory.com/repo/forcedotcom/SalesforceMobileSDK-iOS/…
    – MiGro
    Commented Nov 20, 2021 at 17:04
  • @MiGro yes, I wrote a questions to developers on the GitHub too Commented Nov 22, 2021 at 8:35

2 Answers 2


The problem was fixed in 9.2.1 version of Salesforce Mobile SDK


Did you try to upgrade to 9.2? There is a change in encryption for iOS:


  • Yes, sure. The same problem on 9.2 version. Commented Nov 18, 2021 at 7:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .