flutter_secure_storage icon indicating copy to clipboard operation
flutter_secure_storage copied to clipboard

Resolve error when no item exist (iOS)

Open koji-1009 opened this issue 8 months ago • 1 comments

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.

koji-1009 avatar Dec 10 '23 08:12 koji-1009

We would love to see merged since we also get errSecItemNotFound instead of null. 👍

tenhobi avatar Dec 18 '23 10:12 tenhobi

Looks good, thanks for your contribution!

juliansteenbakker avatar May 06 '24 08:05 juliansteenbakker

@juliansteenbakker Thanks!

koji-1009 avatar May 06 '24 11:05 koji-1009