Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ios): Add support for reading __NSCFData key strings #32

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/ios/SecureStorage.m
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,15 @@ - (void)keys:(CDVInvokedUrlCommand*)command
if (accounts) {
NSMutableArray *array = [NSMutableArray arrayWithCapacity:[accounts count]];
for (id dict in accounts) {
[array addObject:[dict valueForKeyPath:@"acct"]];
if([NSStringFromClass([[dict valueForKeyPath:@"acct"] class]) isEqualToString:@"__NSCFData"]){
@try {
[array addObject:[NSString stringWithUTF8String:[[dict valueForKeyPath:@"acct"] bytes]]];
} @catch (NSException *exception) {
// Just ignore this key :(
}
}else{
[array addObject:[dict valueForKeyPath:@"acct"]];
}
}

CDVPluginResult *commandResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsArray:array];
Expand Down