We have an app that needs to get the keychain values right after launch. I noticed that on the first and second launches after installation, the keychain values are not found until our check has finished. The keychain accessibility is set to .accessibleAfterFirstUnlock, and I have tried to observe ProtectedData Notification and applicationProtectedDataWillBecomeUnavailable delegate method, neither is called. The error received when not able to access keychain is errSecItemNotFound.
This stops happening since the third launch and things back to normal. The keychain values are accessible from beginning since the third launch. But the first and second launches are pretty important to our user experience, so we want to fix this. I wonder if anyone has seen similar things and how to resolve.