diff --git a/ios/RNSensitiveInfo/RNSensitiveInfo.m b/ios/RNSensitiveInfo/RNSensitiveInfo.m index 8f4874bd..114790ab 100644 --- a/ios/RNSensitiveInfo/RNSensitiveInfo.m +++ b/ios/RNSensitiveInfo/RNSensitiveInfo.m @@ -54,7 +54,7 @@ CFStringRef convertkSecAccessControl(NSString* key){ } // Messages from the comments in -NSString *messageForError(NSError *error) +- (NSString *)messageForError:(NSError *)error { switch (error.code) { case errSecUnimplemented: @@ -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); @@ -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; } @@ -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);