Skip to content

Commit 2d4a14c

Browse files
authored
Merge pull request #100 from grigorigoldman/fix-duplicate_symbol_messageForError
Fixed build error when used with react-native-keychain lib
2 parents 7034216 + 2b54a02 commit 2d4a14c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ios/RNSensitiveInfo/RNSensitiveInfo.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ CFStringRef convertkSecAccessControl(NSString* key){
5454
}
5555

5656
// Messages from the comments in <Security/SecBase.h>
57-
NSString *messageForError(NSError *error)
57+
- (NSString *)messageForError:(NSError *)error
5858
{
5959
switch (error.code) {
6060
case errSecUnimplemented:
@@ -128,7 +128,7 @@ CFStringRef convertkSecAccessControl(NSString* key){
128128
osStatus = SecItemAdd((__bridge CFDictionaryRef) query, NULL);
129129
if (osStatus != noErr) {
130130
NSError *error = [NSError errorWithDomain:NSOSStatusErrorDomain code:osStatus userInfo:nil];
131-
reject([NSString stringWithFormat:@"%ld",(long)error.code], messageForError(error), nil);
131+
reject([NSString stringWithFormat:@"%ld",(long)error.code], [self messageForError:error], nil);
132132
return;
133133
}
134134
resolve(nil);
@@ -161,7 +161,7 @@ CFStringRef convertkSecAccessControl(NSString* key){
161161

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

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

0 commit comments

Comments
 (0)