IOS Keychain data lost with iPhone memory pressure?

I am running an iOS application through a debugger on my iPhone 5s. I use keychain to store a password (I use Apple's KeychainItemWrapper example to store and retrieve keychain items). Approximately 99.99% of the time, searching for a keychain works perfectly. However, there were two cases when my application could not get the password. For example, once my phone was under pressure in my memory, and I had to restart the phone and restart the application. After restarting the application, my application can no longer retrieve the password from the key fob. I wonder if this password loss was caused by this memory pressure? What other iOS cases clean up keychain data? Is there any way to introduce this?

+4
source share
2 answers

iOS keychain is very unrelated to your application memory pressure.

Two scenarios are possible:

  • Somehow you are faced with resetting your phone - Keychain data will be lost (if your keychain is not synchronized with icloud).
  • You somehow called resetKeychainItemout of the wrapper .

It is impossible to help without looking at your code.

0
source

Source: https://habr.com/ru/post/1542614/


All Articles