Skip to content

Commit

Permalink
Fixed build error when used with react-native-keychain lib
Browse files Browse the repository at this point in the history
  • Loading branch information
grigorigoldman committed Aug 7, 2018
1 parent 7034216 commit 2b54a02
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ios/RNSensitiveInfo/RNSensitiveInfo.m
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ CFStringRef convertkSecAccessControl(NSString* key){
}

// Messages from the comments in <Security/SecBase.h>
NSString *messageForError(NSError *error)
- (NSString *)messageForError:(NSError *)error
{
switch (error.code) {
case errSecUnimplemented:
Expand Down Expand Up @@ -128,7 +128,7 @@ CFStringRef convertkSecAccessControl(NSString* key){
osStatus = SecItemAdd((__bridge CFDictionaryRef) query, NULL);
if (osStatus != noErr) {
NSError *error = [NSError errorWithDomain:NSOSStatusErrorDomain code:osStatus userInfo:nil];
reject([NSString stringWithFormat:@"%ld",(long)error.code], messageForError(error), nil);
reject([NSString stringWithFormat:@"%ld",(long)error.code], [self messageForError:error], nil);
return;
}
resolve(nil);
Expand Down Expand Up @@ -161,7 +161,7 @@ CFStringRef convertkSecAccessControl(NSString* key){

if (osStatus != noErr && osStatus != errSecItemNotFound) {
NSError *error = [NSError errorWithDomain:NSOSStatusErrorDomain code:osStatus userInfo:nil];
reject([NSString stringWithFormat:@"%ld",(long)error.code], messageForError(error), nil);
reject([NSString stringWithFormat:@"%ld",(long)error.code], [self messageForError:error], nil);
return;
}

Expand Down Expand Up @@ -250,7 +250,7 @@ CFStringRef convertkSecAccessControl(NSString* key){
OSStatus osStatus = SecItemDelete((__bridge CFDictionaryRef) query);
if (osStatus != noErr && osStatus != errSecItemNotFound) {
NSError *error = [NSError errorWithDomain:NSOSStatusErrorDomain code:osStatus userInfo:nil];
reject([NSString stringWithFormat:@"%ld",(long)error.code], messageForError(error), nil);
reject([NSString stringWithFormat:@"%ld",(long)error.code], [self messageForError:error], nil);
return;
}
resolve(nil);
Expand Down

0 comments on commit 2b54a02

Please sign in to comment.