I have a Mobile App developed in Objective C which has two SDK's writing to the keychain. The first SDK which is completely written in Swift, uses Swift to write and read the key chain and the second SDK uses Objective C to read and write to the SDK. When the first SDK reads from the keychain, the second SDK is not able to read from the keychain and it is getting the Keychain error of item not found. Both the SDK's are using different keys and so not sure why the second SDK is getting item not found. The weird thing with this error is it happens only on a Simulator and it is working fine on actual iPhone. I have also checked the Objective C to Swift bridging header and everything looks correct. Any help you can provide is highly appreciated.
Multiple SDK's writing to the Keychain but not able to read from the Keychain
It’s hard to answer this without more details about the exact APIs that these libraries are using. Do you have source code for them?
In general, the keychain API is tricky to use correctly. I talk about this extensively in:
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
I have the Source Code for the First SDK and the Second SDK is developed by a third party vendor and we do not have access to their source code. I have prototyped the second SDK functionality by creating a Sample App written in Objective C, invoking the first SDK code and for the second SDK code, I wrote a sample word "Hello" to the Keychain using Objective C but when I read it, it comes back as item not found(which is the root issue). I can share the zip file which contains this Sample App, can you please share a link where I can drop this zip file? The root issue is pretty straightforward, if we write to keychain with one key(lets say key1) using Swift and again write to the keychain using Objective C using a different key(lets say key2) and try to read the values from the keychain using the keys, for key 2 the value is coming back as item not found and this happens only on a Simulator and works fine on an actual iPhone. Any input/help you can provide is highly appreciated. Thanks.