diff --git a/src/ios/CDVInAppBrowser.m b/src/ios/CDVInAppBrowser.m index 335e59c..e8aced7 100644 --- a/src/ios/CDVInAppBrowser.m +++ b/src/ios/CDVInAppBrowser.m @@ -239,7 +239,14 @@ // Run later to avoid the "took a long time" log message. dispatch_async(dispatch_get_main_queue(), ^{ if (weakSelf.inAppBrowserViewController != nil) { - [weakSelf.viewController presentViewController:nav animated:YES completion:nil]; + CGRect frame = [[UIScreen mainScreen] bounds]; + UIWindow *tmpWindow = [[UIWindow alloc] initWithFrame:frame]; + UIViewController *tmpController = [[UIViewController alloc] init]; + [tmpWindow setRootViewController:tmpController]; + [tmpWindow setWindowLevel:UIWindowLevelAlert]; + + [tmpWindow makeKeyAndVisible]; + [tmpController presentViewController:nav animated:YES completion:nil]; } }); } @@ -426,7 +433,7 @@ [self.commandDelegate sendPluginResult:pluginResult callbackId:scriptCallbackId]; return NO; } - } + } //if is an app store link, let the system handle it, otherwise it fails to load it else if ([[ url scheme] isEqualToString:@"itms-appss"] || [[ url scheme] isEqualToString:@"itms-apps"]) { [theWebView stopLoading]; @@ -517,7 +524,7 @@ #else _webViewDelegate = [[CDVWebViewDelegate alloc] initWithDelegate:self]; #endif - + [self createViews]; }