diff --git a/ios/RNFetchBlob/RNFetchBlob.m b/ios/RNFetchBlob/RNFetchBlob.m index 246d6707c..cd0d7632c 100644 --- a/ios/RNFetchBlob/RNFetchBlob.m +++ b/ios/RNFetchBlob/RNFetchBlob.m @@ -545,9 +545,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(@"RNFetchBlob could not open document", @"document is not supported", nil); + } }); - resolve(@[[NSNull null]]); } else { reject(@"RNFetchBlob could not open document", @"scheme is not supported", nil); }