cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shazron <shaz...@gmail.com>
Subject Re: Ios cordova app randomly got frozen after dismissing inappbrowser
Date Sat, 11 Mar 2017 02:28:47 GMT
Which version of InAppBrowser was installed?

Sounds like a good idea to add the conditional since that fix was added for
WKWebView:
https://github.com/apache/cordova-plugin-inappbrowser/commit/f32917df314f08296c53a4de0255a424be773184

Let me know what you need to get that PR going.


On Fri, Mar 10, 2017 at 11:00 AM, Li, Jonathan <jonathan.li@sap.com> wrote:

> Hi,
>
> During the recent testing of our ios cordova applications, we got an issue
> of the app’s main UIwebview UI freezing after dismissing the inappbrowser.
> Debugging shows somehow the UIWindow created by inappbrowser did not
> deallocated as expected after calling the close method to dismiss the
> inappbrowser. So although the inappbrowser’s UIWindows is invisiable, but
> it is still the keywindow and receive the user input. The xcode instrument
> shows there is only one reference on the inappbrowser’s UIWindow object ,
> which is expected to be released after dismissing the inappbrowser
> viewcontroller. Although this part of logic is inside the Apple SDK, and
> not sure exactly when the UIWindow is released within the Apple SDK. Note
> this happens randomly, so it may be a timing related issue.
>
> Just wonder whether anyone else has seen the similar issue? Or have any
> idea about it. Both main webview and inappbrwoser webview use UIWebView to
> show the html content. WKWebview is not involved.
>
> For now, we added an if condition in the show method in dispatch_async
> block in our inappbrowser.m to work around the issue, but if others see the
> same thing, we will need to have a pull request for this change.
>
> - (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) {
>             if ([weakSelf.inAppBrowserViewController.webView
> isKindOfClass:[WKWebView class]]) {
>                                 CGRect frame = [[UIScreen mainScreen]
> bounds];
>                                 UIWindow *tmpWindow = [[UIWindow alloc]
> initWithFrame:frame];
>                                 UIViewController *tmpController =
> [[UIViewController alloc] init];
>                                 [tmpWindow setRootViewController:
> tmpController];
>                                 [tmpWindow setWindowLevel:
> UIWindowLevelNormal];
>
>                                 [tmpWindow makeKeyAndVisible];
>                                 [tmpController presentViewController:nav
> animated:YES completion:nil];
>             }
>             else {
>   [weakSelf.viewController presentViewController:nav animated:YES
> completion:nil];
>             }
>         }
>     });
> }
>
> Thanks
> Jonathan
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message