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