You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2018/07/11 22:30:34 UTC
[GitHub] jcesarmobile closed pull request #272: CB-12922 (ios): fix In-app
browser does not cede control
jcesarmobile closed pull request #272: CB-12922 (ios): fix In-app browser does not cede control
URL: https://github.com/apache/cordova-plugin-inappbrowser/pull/272
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/src/ios/CDVInAppBrowser.h b/src/ios/CDVInAppBrowser.h
index 25fae3f3e..66066b9ba 100644
--- a/src/ios/CDVInAppBrowser.h
+++ b/src/ios/CDVInAppBrowser.h
@@ -30,6 +30,7 @@
@class CDVInAppBrowserViewController;
@interface CDVInAppBrowser : CDVPlugin {
+ UIWindow * tmpWindow;
}
@property (nonatomic, retain) CDVInAppBrowserViewController* inAppBrowserViewController;
diff --git a/src/ios/CDVInAppBrowser.m b/src/ios/CDVInAppBrowser.m
index c65e3e150..5bdb3e1eb 100644
--- a/src/ios/CDVInAppBrowser.m
+++ b/src/ios/CDVInAppBrowser.m
@@ -239,8 +239,10 @@ - (void)show:(CDVInvokedUrlCommand*)command
// Run later to avoid the "took a long time" log message.
dispatch_async(dispatch_get_main_queue(), ^{
if (weakSelf.inAppBrowserViewController != nil) {
- CGRect frame = [[UIScreen mainScreen] bounds];
- UIWindow *tmpWindow = [[UIWindow alloc] initWithFrame:frame];
+ if (!tmpWindow) {
+ CGRect frame = [[UIScreen mainScreen] bounds];
+ tmpWindow = [[UIWindow alloc] initWithFrame:frame];
+ }
UIViewController *tmpController = [[UIViewController alloc] init];
[tmpWindow setRootViewController:tmpController];
[tmpWindow setWindowLevel:UIWindowLevelNormal];
@@ -270,7 +272,9 @@ - (void)hide:(CDVInvokedUrlCommand*)command
dispatch_async(dispatch_get_main_queue(), ^{
if (self.inAppBrowserViewController != nil) {
_previousStatusBarStyle = -1;
- [self.inAppBrowserViewController.presentingViewController dismissViewControllerAnimated:YES completion:nil];
+ [self.inAppBrowserViewController.presentingViewController dismissViewControllerAnimated:YES completion:^{
+ [[[[UIApplication sharedApplication] delegate] window] makeKeyAndVisible];
+ }];
}
});
}
@@ -835,9 +839,13 @@ - (void)close
// Run later to avoid the "took a long time" log message.
dispatch_async(dispatch_get_main_queue(), ^{
if ([weakSelf respondsToSelector:@selector(presentingViewController)]) {
- [[weakSelf presentingViewController] dismissViewControllerAnimated:YES completion:nil];
+ [[weakSelf presentingViewController] dismissViewControllerAnimated:YES completion:^{
+ [[[[UIApplication sharedApplication] delegate] window] makeKeyAndVisible];
+ }];
} else {
- [[weakSelf parentViewController] dismissViewControllerAnimated:YES completion:nil];
+ [[weakSelf parentViewController] dismissViewControllerAnimated:YES completion:^{
+ [[[[UIApplication sharedApplication] delegate] window] makeKeyAndVisible];
+ }];
}
});
}
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org