flutter_secure_storage
flutter_secure_storage copied to clipboard
iOSOptions with null group fails to add key to keychain
Inside FlutterSecureStoragePlugin.m -> write
function, there is following line:
if(groupId != nil) { search[(__bridge id)kSecAttrAccessGroup] = groupId; }
Same check exists read
function as well.
This results in search
dictionary having nsnull
value. As a result, SecItemAdd
results in errSecParam (-50)
.
This problem is observed on iOS 13 simulator.
Checking !(groupId == [NSNull null])
fixes the problem with null groupId
.
When groupId is not supplied from flutter, this check fails because groupId is NSNull
.
Supplying groupId may fix the problem but will require TEAM to be known to specify keychain access group, which is not always possible.
Any updates on this issue?
Any updates?
I'm not really familiar with obj-c code, so how should we check for NSNull? Implementing it like this gives the following error:
Comparison of distinct pointer types
if(groupId != nil || groupId != [NSNull null]) {
search[(__bridge id)kSecAttrAccessGroup] = groupId;
}