Skip to content
Permalink
Browse files
(ios) Fix iOS 13 show not working
Removed tmpWindow and controller.
This was introduced to fix IAB with WKWebView before WKIAB existed.
  • Loading branch information
NiklasMerz committed Sep 6, 2019
1 parent 8805f5d commit 81bec095266ffccecbb052408445259c00f27344
Showing 2 changed files with 4 additions and 22 deletions.
@@ -27,8 +27,6 @@
@class CDVWKInAppBrowserViewController;

@interface CDVWKInAppBrowser : CDVPlugin {
UIWindow * tmpWindow;

@private
NSString* _beforeload;
BOOL _waitForBeforeload;
@@ -275,7 +275,9 @@ - (void)openInInAppBrowser:(NSURL*)url withOptions:(NSString*)options
_waitForBeforeload = ![_beforeload isEqualToString:@""];

[self.inAppBrowserViewController navigateTo:url];
[self show:nil withNoAnimate:browserOptions.hidden];
if (!browserOptions.hidden) {
[self show:nil withNoAnimate:browserOptions.hidden];
}
}

- (void)show:(CDVInvokedUrlCommand*)command{
@@ -312,25 +314,7 @@ - (void)show:(CDVInvokedUrlCommand*)command withNoAnimate:(BOOL)noAnimate

// Run later to avoid the "took a long time" log message.
dispatch_async(dispatch_get_main_queue(), ^{
if (weakSelf.inAppBrowserViewController != 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];
}
[weakSelf.viewController presentViewController:nav animated:!noAnimate completion:nil];
});
}

0 comments on commit 81bec09

Please sign in to comment.