Open
Description
I discovered that if you access the keychain soon after launching / coming to foreground keychain will return an error instead of the data. To fix this I'll be keeping the accessToken
and refreshToken
is memory instead of fetching from keychain every time. I'll also be changing the kSecAttrAccessible
to kSecAttrAccessibleAfterFirstUnlock
. As for getting the key ASAP after app launch I can only recommend trying to delay accessing the token.
Some threads on the issue
https://forums.developer.apple.com/thread/4743
https://forums.developer.apple.com/message/351282#351282
I haven't found any other solutions, but if anyone has any other suggestions I'm all ears.