|
@@ -587,9 +587,12 @@ RCT_EXPORT_METHOD(openDocument:(NSString*)uri scheme:(NSString *)scheme resolver
|
587
|
587
|
|
588
|
588
|
if(scheme == nil || [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:scheme]]) {
|
589
|
589
|
dispatch_sync(dispatch_get_main_queue(), ^{
|
590
|
|
- [documentController presentPreviewAnimated:YES];
|
|
590
|
+ if([documentController presentPreviewAnimated:YES]) {
|
|
591
|
+ resolve(@[[NSNull null]]);
|
|
592
|
+ } else {
|
|
593
|
+ reject(@"EINVAL", @"document is not supported", nil);
|
|
594
|
+ }
|
591
|
595
|
});
|
592
|
|
- resolve(@[[NSNull null]]);
|
593
|
596
|
} else {
|
594
|
597
|
reject(@"EINVAL", @"scheme is not supported", nil);
|
595
|
598
|
}
|