flutter_secure_storage
flutter_secure_storage copied to clipboard
Resolve error when no item exist (iOS)
Fixes #391
On iOS, readAll
(or deleteAll
) will return error code errSecItemNotFound
(-25300
) if the item does not exist in the keychain. This is due to the error code errSecItemNotFound
returned by SecItemCopyMatching
(or SecItemDelete
).
This is expected behavior for iOS processing and is not a bug.
https://developer.apple.com/documentation/security/1542001-security_framework_result_codes/errsecitemnotfound
Therefore, this fix modifies the functions to return nil
in cases when errSecItemNotFound
is returned.
We would love to see merged since we also get errSecItemNotFound
instead of null
. 👍
Looks good, thanks for your contribution!
@juliansteenbakker Thanks!