Skip to content

Commit

Permalink
Merge pull request joltup#41 from genabasov/0.10.9
Browse files Browse the repository at this point in the history
Reject promise by iOS openDocument when a file is not opened
  • Loading branch information
Traviskn authored Jun 23, 2018
2 parents 9cb0f14 + c5de6f8 commit 33d55c0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ios/RNFetchBlob/RNFetchBlob.m
Original file line number Diff line number Diff line change
Expand Up @@ -587,9 +587,12 @@ - (NSDictionary *)constantsToExport

if(scheme == nil || [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:scheme]]) {
dispatch_sync(dispatch_get_main_queue(), ^{
[documentController presentPreviewAnimated:YES];
if([documentController presentPreviewAnimated:YES]) {
resolve(@[[NSNull null]]);
} else {
reject(@"EINVAL", @"document is not supported", nil);
}
});
resolve(@[[NSNull null]]);
} else {
reject(@"EINVAL", @"scheme is not supported", nil);
}
Expand Down

0 comments on commit 33d55c0

Please sign in to comment.