[ 
https://issues.apache.org/jira/browse/CB-12922?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16540765#comment-16540765
 ] 

ASF GitHub Bot commented on CB-12922:
-------------------------------------

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:
[email protected]


> [iOS] In-app browser does not cede control after actions on certain pages
> -------------------------------------------------------------------------
>
>                 Key: CB-12922
>                 URL: https://issues.apache.org/jira/browse/CB-12922
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: cordova-plugin-inappbrowser
>            Reporter: Ben Williams
>            Assignee: jcesarmobile
>            Priority: Critical
>         Attachments: nest_iab.zip
>
>
> This issue only occurs on the iOS version of inappbrowser.
> When opening the Nest login (https://home.nest.com/login/) page in the 
> inappbrowser, clicking Sign In (with or without valid credentials) and 
> subsequently closing the browser, the main cordova page becomes unresponsive, 
> receiving no touch events whatsoever.
> I have created a barebones application which exhibits the issue, which I will 
> attach.
> Thank you.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to