[
https://issues.apache.org/jira/browse/CB-12586?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15937363#comment-15937363
]
Shazron Abdullah commented on CB-12586:
---------------------------------------
For reference, we are talking about this existing code:
https://github.com/apache/cordova-plugin-inappbrowser/blob/c9ff78abfda78d89df887369da22ba2cd5f29159/src/ios/CDVInAppBrowser.m#L270-L275
This is where it is shown:
https://github.com/apache/cordova-plugin-inappbrowser/blob/c9ff78abfda78d89df887369da22ba2cd5f29159/src/ios/CDVInAppBrowser.m#L239-L251
(also any UIKit work has to be in the main queue)
I haven't tested this (nor have I tested whether this bug can be repro'ed yet)
but perhaps this should work:
{code}
[[self presentingViewController] dismissViewControllerAnimated:YES
completion:nil]
{code}
[~jcesarmobile] we can't ask the temp view controller that is used in show,
since it was temporary and has no reference
> [iOS] Method hide doesn't works
> -------------------------------
>
> Key: CB-12586
> URL: https://issues.apache.org/jira/browse/CB-12586
> Project: Apache Cordova
> Issue Type: Bug
> Components: Plugin InAppBrowser
> Affects Versions: 1.7.0
> Environment: I have tested on the iPhone 7 with iOS 10.2.1 and the
> iPhone 6 Plus with iOS 10.2
> Reporter: Roberto Orden Erena
>
> I have using the `hide()` method in order to hide the webview window when the
> mobile hasn't wifi connection, in Android works fine, but in iOS not.
> My temporal solution for this is:
> {code}
> // Run later to avoid the "took a long time" log message.
> dispatch_async(dispatch_get_global_queue(
> DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
> if (weakSelf.inAppBrowserViewController != nil) {
> _previousStatusBarStyle = -1;
> [weakSelf.viewController dismissViewControllerAnimated:YES
> completion:nil];
> // I have added this line in order to hide the webview
> [weakSelf.inAppBrowserViewController
> dismissViewControllerAnimated:YES completion:nil];
> }
> });
> {code}
> I think that : "what is the weakSelf.viewController?", when shows and when
> creates the inAppBrowser the plugin uses self.inAppBrowserViewController. Why
> use at this point viewController instead of?
> Note: It's my first issue report, If I have done wrong it, please notify me
> in order to do better the next time.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]