From 87edc8ae3a1de11cddf4cf9f58c4320ce1494019 Mon Sep 17 00:00:00 2001 From: Dani Akash Date: Tue, 28 Mar 2017 00:40:09 +0530 Subject: [PATCH] add "open with" dialogue box in ipad. This contains the fix for commit - https://github.com/kristikristo/react-native-file-opener/commit/89ba83ed63776d51030d8c6d423fa48b22cd5aed CGRectMake in line 14 is not a proper return type. It is a function. hence it is removed and the menu containing the list of applications to open the file with is created manually in line 37. fixes huangzuizui/react-native-file-opener#15 --- ios/RNFileOpener/RNFileOpener.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ios/RNFileOpener/RNFileOpener.m b/ios/RNFileOpener/RNFileOpener.m index 092bb7b0..ef8b4a22 100644 --- a/ios/RNFileOpener/RNFileOpener.m +++ b/ios/RNFileOpener/RNFileOpener.m @@ -11,7 +11,7 @@ - (dispatch_queue_t)methodQueue RCT_EXPORT_MODULE(); -RCT_REMAP_METHOD(open, filePath:(NSString *)filePath fileMine:(NSString *)fileMine fromRect:(CGRectMake)rect +RCT_REMAP_METHOD(open, filePath:(NSString *)filePath fileMine:(NSString *)fileMine resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) { @@ -34,7 +34,7 @@ - (dispatch_queue_t)methodQueue if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { - wasOpened = [self.FileOpener presentOptionsMenuFromRect:rect inView:ctrl.view animated:YES]; + wasOpened = [self.FileOpener presentOptionsMenuFromRect:CGRectMake(CGRectGetMidX(ctrl.view.frame), CGRectGetMidY(ctrl.view.frame), 0, 20) inView:ctrl.view animated:YES]; } if (wasOpened) {