From e90645bee087ec66dd897c72ce56e4c50ef633f5 Mon Sep 17 00:00:00 2001 From: Bruno-bm Date: Mon, 7 Jan 2019 10:55:45 -0200 Subject: [PATCH] Present notification view controller by inappbrowser v iew controller * (IOS) notification window does not show when inappbrowser window is presented --- src/ios/FileOpener2.m | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/ios/FileOpener2.m b/src/ios/FileOpener2.m index 257a356..761096d 100644 --- a/src/ios/FileOpener2.m +++ b/src/ios/FileOpener2.m @@ -104,6 +104,14 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @implementation FileOpener2 (UIDocumentInteractionControllerDelegate) - (UIViewController *)documentInteractionControllerViewControllerForPreview:(UIDocumentInteractionController *)controller { - return self.cdvViewController; + UIViewController *presentingViewController = self.viewController; + if (presentingViewController.view.window != [UIApplication sharedApplication].keyWindow){ + presentingViewController = [UIApplication sharedApplication].keyWindow.rootViewController; + } + + while (presentingViewController.presentedViewController != nil && ![presentingViewController.presentedViewController isBeingDismissed]){ + presentingViewController = presentingViewController.presentedViewController; + } + return presentingViewController; } @end