mirror of
https://github.com/shuto-cn/cordova-plugin-inappbrowser.git
synced 2025-02-24 19:12:57 +08:00
(ios) Fix inappbrowser not opening on iOS 13 by using reusable window
Closes #492
This commit is contained in:
parent
2b59941514
commit
8810c6a8a0
@ -27,6 +27,8 @@
|
|||||||
@class CDVWKInAppBrowserViewController;
|
@class CDVWKInAppBrowserViewController;
|
||||||
|
|
||||||
@interface CDVWKInAppBrowser : CDVPlugin {
|
@interface CDVWKInAppBrowser : CDVPlugin {
|
||||||
|
UIWindow * tmpWindow;
|
||||||
|
|
||||||
@private
|
@private
|
||||||
NSString* _beforeload;
|
NSString* _beforeload;
|
||||||
BOOL _waitForBeforeload;
|
BOOL _waitForBeforeload;
|
||||||
|
@ -314,12 +314,13 @@ static CDVWKInAppBrowser* instance = nil;
|
|||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
if (weakSelf.inAppBrowserViewController != nil) {
|
if (weakSelf.inAppBrowserViewController != nil) {
|
||||||
float osVersion = [[[UIDevice currentDevice] systemVersion] floatValue];
|
float osVersion = [[[UIDevice currentDevice] systemVersion] floatValue];
|
||||||
|
if (!tmpWindow) {
|
||||||
CGRect frame = [[UIScreen mainScreen] bounds];
|
CGRect frame = [[UIScreen mainScreen] bounds];
|
||||||
if(initHidden && osVersion < 11){
|
if(initHidden && osVersion < 11){
|
||||||
frame.origin.x = -10000;
|
frame.origin.x = -10000;
|
||||||
}
|
}
|
||||||
|
tmpWindow = [[UIWindow alloc] initWithFrame:frame];
|
||||||
UIWindow *tmpWindow = [[UIWindow alloc] initWithFrame:frame];
|
}
|
||||||
UIViewController *tmpController = [[UIViewController alloc] init];
|
UIViewController *tmpController = [[UIViewController alloc] init];
|
||||||
|
|
||||||
[tmpWindow setRootViewController:tmpController];
|
[tmpWindow setRootViewController:tmpController];
|
||||||
|
Loading…
Reference in New Issue
Block a user