I am using the keychain with iOS7 as target, I use the attribute : kSecAttrAccessibleWhenUnlockedThisDeviceOnly
It is working great, after 10sec when the device is lock the keychain variables are not accessible.
What I want now is to delete the keychain before the app is killed. applicationWillTerminate
is only called if the app is killed before going into background or if the system release the application. If the app is in background for like 1min before being killed by the user, I can't find how to clear the keychain.
Is there any way to delete the keychain or have a function called when the app is killed by the user after several minute in background ?