(ios) Fix iOS 13 show not working
Removed tmpWindow and controller. This was introduced to fix IAB with WKWebView before WKIAB existed.
This commit is contained in:
parent
8805f5d46a
commit
81bec09526
@ -27,8 +27,6 @@
|
|||||||
@class CDVWKInAppBrowserViewController;
|
@class CDVWKInAppBrowserViewController;
|
||||||
|
|
||||||
@interface CDVWKInAppBrowser : CDVPlugin {
|
@interface CDVWKInAppBrowser : CDVPlugin {
|
||||||
UIWindow * tmpWindow;
|
|
||||||
|
|
||||||
@private
|
@private
|
||||||
NSString* _beforeload;
|
NSString* _beforeload;
|
||||||
BOOL _waitForBeforeload;
|
BOOL _waitForBeforeload;
|
||||||
|
@ -275,7 +275,9 @@ static CDVWKInAppBrowser* instance = nil;
|
|||||||
_waitForBeforeload = ![_beforeload isEqualToString:@""];
|
_waitForBeforeload = ![_beforeload isEqualToString:@""];
|
||||||
|
|
||||||
[self.inAppBrowserViewController navigateTo:url];
|
[self.inAppBrowserViewController navigateTo:url];
|
||||||
[self show:nil withNoAnimate:browserOptions.hidden];
|
if (!browserOptions.hidden) {
|
||||||
|
[self show:nil withNoAnimate:browserOptions.hidden];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)show:(CDVInvokedUrlCommand*)command{
|
- (void)show:(CDVInvokedUrlCommand*)command{
|
||||||
@ -312,25 +314,7 @@ static CDVWKInAppBrowser* instance = nil;
|
|||||||
|
|
||||||
// Run later to avoid the "took a long time" log message.
|
// Run later to avoid the "took a long time" log message.
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
if (weakSelf.inAppBrowserViewController != nil) {
|
[weakSelf.viewController presentViewController:nav animated:!noAnimate completion:nil];
|
||||||
float osVersion = [[[UIDevice currentDevice] systemVersion] floatValue];
|
|
||||||
if (!self->tmpWindow) {
|
|
||||||
CGRect frame = [[UIScreen mainScreen] bounds];
|
|
||||||
if(initHidden && osVersion < 11){
|
|
||||||
frame.origin.x = -10000;
|
|
||||||
}
|
|
||||||
self->tmpWindow = [[UIWindow alloc] initWithFrame:frame];
|
|
||||||
}
|
|
||||||
UIViewController *tmpController = [[UIViewController alloc] init];
|
|
||||||
|
|
||||||
[self->tmpWindow setRootViewController:tmpController];
|
|
||||||
[self->tmpWindow setWindowLevel:UIWindowLevelNormal];
|
|
||||||
|
|
||||||
if(!initHidden || osVersion < 11){
|
|
||||||
[self->tmpWindow makeKeyAndVisible];
|
|
||||||
}
|
|
||||||
[tmpController presentViewController:nav animated:!noAnimate completion:nil];
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user