[
https://issues.apache.org/jira/browse/CB-12586?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15964532#comment-15964532
]
Oliver Weiss edited comment on CB-12586 at 4/11/17 3:45 PM:
------------------------------------------------------------
Hey,
I have the same issue with multiple iPads. I am not experienced with Cordova
Plugins. I am using the newest version of InAppBrowser (1.7.0) now. But they
did not fix this.
I changed the hide function in the
cordova-plugin-inappbrowser/src/ios/CDVInAppBrowser.m to the following, but the
ref.hide() is still not working after "cordova build". Can you tell me, if I
did something wrong? This is a major problem for me right now :( I need to hide
the InAppBrowser to work with a camera plugin. Another possibility would be to
make the InAppBrowser transparent. But I have no idea how to make this work. So
I need the hide() function to work...
Thanks for the help!
{code}
- (void)hide:(CDVInvokedUrlCommand*)command
{
if (self.inAppBrowserViewController == nil) {
NSLog(@"Tried to hide IAB after it was closed.");
return;
}
if (_previousStatusBarStyle == -1) {
NSLog(@"Tried to hide IAB while already hidden");
return;
}
__weak CDVInAppBrowser* weakSelf = self;
// 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.inAppBrowserViewController.presentingViewController
dismissViewControllerAnimated:YES completion:nil];
}
});
}
{code}
was (Author: oliver.weiss):
Hey,
I have the same issue with multiple iPads. I am not experienced with Cordova
Plugins. I am using the newest version of InAppBrowser (1.7.0) now. But they
did not fix this.
I changed the hide function in the CDVInAppBrowser.m to the following, but the
ref.hide() is still not working after "cordova build". Can you tell me, if I
did something wrong? This is a major problem for me right now :( I need to hide
the InAppBrowser to work with a camera plugin. Another possibility would be to
make the InAppBrowser transparent. But I have no idea how to make this work. So
I need the hide() function to work...
Thanks for the help!
{code}
- (void)hide:(CDVInvokedUrlCommand*)command
{
if (self.inAppBrowserViewController == nil) {
NSLog(@"Tried to hide IAB after it was closed.");
return;
}
if (_previousStatusBarStyle == -1) {
NSLog(@"Tried to hide IAB while already hidden");
return;
}
__weak CDVInAppBrowser* weakSelf = self;
// 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.inAppBrowserViewController.presentingViewController
dismissViewControllerAnimated:YES completion:nil];
}
});
}
{code}
> [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]