Merge pull request #272 from jcesarmobile/CB-12922
CB-12922 (ios): fix In-app browser does not cede control
This commit is contained in:
commit
9cc7f69625
@ -30,6 +30,7 @@
|
|||||||
@class CDVInAppBrowserViewController;
|
@class CDVInAppBrowserViewController;
|
||||||
|
|
||||||
@interface CDVInAppBrowser : CDVPlugin {
|
@interface CDVInAppBrowser : CDVPlugin {
|
||||||
|
UIWindow * tmpWindow;
|
||||||
}
|
}
|
||||||
|
|
||||||
@property (nonatomic, retain) CDVInAppBrowserViewController* inAppBrowserViewController;
|
@property (nonatomic, retain) CDVInAppBrowserViewController* inAppBrowserViewController;
|
||||||
|
@ -239,8 +239,10 @@
|
|||||||
// 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) {
|
if (weakSelf.inAppBrowserViewController != nil) {
|
||||||
|
if (!tmpWindow) {
|
||||||
CGRect frame = [[UIScreen mainScreen] bounds];
|
CGRect frame = [[UIScreen mainScreen] bounds];
|
||||||
UIWindow *tmpWindow = [[UIWindow alloc] initWithFrame:frame];
|
tmpWindow = [[UIWindow alloc] initWithFrame:frame];
|
||||||
|
}
|
||||||
UIViewController *tmpController = [[UIViewController alloc] init];
|
UIViewController *tmpController = [[UIViewController alloc] init];
|
||||||
[tmpWindow setRootViewController:tmpController];
|
[tmpWindow setRootViewController:tmpController];
|
||||||
[tmpWindow setWindowLevel:UIWindowLevelNormal];
|
[tmpWindow setWindowLevel:UIWindowLevelNormal];
|
||||||
@ -270,7 +272,9 @@
|
|||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
if (self.inAppBrowserViewController != nil) {
|
if (self.inAppBrowserViewController != nil) {
|
||||||
_previousStatusBarStyle = -1;
|
_previousStatusBarStyle = -1;
|
||||||
[self.inAppBrowserViewController.presentingViewController dismissViewControllerAnimated:YES completion:nil];
|
[self.inAppBrowserViewController.presentingViewController dismissViewControllerAnimated:YES completion:^{
|
||||||
|
[[[[UIApplication sharedApplication] delegate] window] makeKeyAndVisible];
|
||||||
|
}];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -835,9 +839,13 @@
|
|||||||
// 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 respondsToSelector:@selector(presentingViewController)]) {
|
if ([weakSelf respondsToSelector:@selector(presentingViewController)]) {
|
||||||
[[weakSelf presentingViewController] dismissViewControllerAnimated:YES completion:nil];
|
[[weakSelf presentingViewController] dismissViewControllerAnimated:YES completion:^{
|
||||||
|
[[[[UIApplication sharedApplication] delegate] window] makeKeyAndVisible];
|
||||||
|
}];
|
||||||
} else {
|
} else {
|
||||||
[[weakSelf parentViewController] dismissViewControllerAnimated:YES completion:nil];
|
[[weakSelf parentViewController] dismissViewControllerAnimated:YES completion:^{
|
||||||
|
[[[[UIApplication sharedApplication] delegate] window] makeKeyAndVisible];
|
||||||
|
}];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user