Skip to content

[WIP] add macOS support #282

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
24 changes: 12 additions & 12 deletions ios/RNSensitiveInfo/RNSensitiveInfo.m
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,13 @@ - (NSString *)messageForError:(NSError *)error
}

dispatch_async(dispatch_get_main_queue(), ^{
if (UIApplication.sharedApplication.protectedDataAvailable) {
// if (UIApplication.sharedApplication.protectedDataAvailable) {
[self getItemWithQuery:query resolver:resolve rejecter:reject];
} else {
// TODO: could change to instead of erroring out, listen for protectedDataDidBecomeAvailable and call getItemWIthQuery when it does
// Experiment for now by returning an error and let the js side retry
reject(@"protected_data_unavailable", @"Protected data not available yet. Retry operation", nil);
}
// } else {
// // TODO: could change to instead of erroring out, listen for protectedDataDidBecomeAvailable and call getItemWIthQuery when it does
// // Experiment for now by returning an error and let the js side retry
// reject(@"protected_data_unavailable", @"Protected data not available yet. Retry operation", nil);
// }
});
}

Expand All @@ -243,7 +243,7 @@ - (NSString *)messageForError:(NSError *)error


dispatch_async(dispatch_get_main_queue(), ^{
if (UIApplication.sharedApplication.protectedDataAvailable) {
// if (UIApplication.sharedApplication.protectedDataAvailable) {
// Look up server in the keychain
NSDictionary* found = nil;
CFTypeRef foundTypeRef = NULL;
Expand All @@ -262,11 +262,11 @@ - (NSString *)messageForError:(NSError *)error
// Found
resolve(@(TRUE));
}
} else {
// TODO: could change to instead of erroring out, listen for protectedDataDidBecomeAvailable and call getItemWIthQuery when it does
// Experiment for now by returning an error and let the js side retry
reject(@"protected_data_unavailable", @"Protected data not available yet. Retry operation", nil);
}
// } else {
// // TODO: could change to instead of erroring out, listen for protectedDataDidBecomeAvailable and call getItemWIthQuery when it does
// // Experiment for now by returning an error and let the js side retry
// reject(@"protected_data_unavailable", @"Protected data not available yet. Retry operation", nil);
// }
});
}

Expand Down
2 changes: 1 addition & 1 deletion react-native-sensitive-info.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Pod::Spec.new do |s|

s.authors = package['author']
s.homepage = package['homepage']
s.platforms = { :ios => "8.0" }
s.platforms = { :ios => "8.0", :osx => "10.15" }

s.source = { :git => "https://github.com/mCodex/react-native-sensitive-info", :tag => "v#{s.version}" }
s.source_files = "ios/**/*.{h,m}"
Expand Down