mirror of
https://github.com/shuto-cn/cordova-plugin-inappbrowser.git
synced 2025-02-24 11:03:10 +08:00
CB-11136: (ios) Fix InAppBrowser when closing with WKWebView
This closes #187
This commit is contained in:
parent
d735649fcd
commit
f32917df31
@ -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];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user