Suppose the following situation:
- The user restarts his iPhone.
- The user allows you to lock the device, does not unlock it.
- The server sends a (quiet) push notification to the devices (or something happens that wakes the application to the background, for example, Apple Watch renewal request data, etc.).
- The application wakes up and tries to access Keychain items saved using the
kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly accessibility.
Keychain items should no longer be available since the device is not yet unlocked. How to check this situation?
Note. In my case, the presence of an element stored in the keychain determines whether the application is βactiveβ or not, so I need something to stop this check soon enough, otherwise my application will consider it inactive (the value cannot be read) and execute the init steps ...
source share