Browse Source

Change ios.openDocument implementation #158

Ben Hsieh 7 years ago
parent
commit
cc31795d11
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      src/ios/RNFetchBlob/RNFetchBlob.m

+ 2
- 1
src/ios/RNFetchBlob/RNFetchBlob.m View File

@@ -68,6 +68,7 @@ RCT_EXPORT_MODULE();
68 68
 - (NSDictionary *)constantsToExport
69 69
 {
70 70
     return @{
71
+             @"MainBundleDir" : [RNFetchBlobFS getMainBundleDir],
71 72
              @"DocumentDir": [RNFetchBlobFS getDocumentDir],
72 73
              @"CacheDir" : [RNFetchBlobFS getCacheDir]
73 74
              };
@@ -445,7 +446,7 @@ RCT_EXPORT_METHOD(openDocument:(NSString*)uri scheme:(NSString *)scheme resolver
445 446
     UIViewController *rootCtrl = [[[[UIApplication sharedApplication] delegate] window] rootViewController];
446 447
     documentController.delegate = self;
447 448
     if(scheme == nil || [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:scheme]]) {
448
-        [documentController  presentOpenInMenuFromRect:rootCtrl.view.bounds inView:rootCtrl.view animated:YES];
449
+        [documentController  presentOptionsMenuFromRect:rootCtrl.view.bounds inView:rootCtrl.view animated:YES];
449 450
         resolve(@[[NSNull null]]);
450 451
     } else {
451 452
         reject(@"RNFetchBlob could not open document", @"scheme is not supported", nil);