Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS / Cordova: InAppBrowser not working

I'm building an app for Android and iOS using Cordva (v3.3.0) and JQuery Mobile. Now I'm trying to use the InAppBrowser plugin. On Android this works fine but on iOS the webpage seems to open in the Cordova WebView and not in the system browser. The problem ist that it is not possible to return to the app as soon as the browser is opened because there is no location bar / back button.

I already tryed to remove the plugin and to add it again and I also updated Cordova to the latest Version (3.3.0)

Can anybody help me to find the Bug?

Thanks!

config.xml

<access origin="*" />
<feature name="InAppBrowser">
    <param name="ios-package" value="CDVInAppBrowser" />
</feature>

index.html

<a href="#" onclick="window.open('http://google.com', '_system', 'location=yes');" data-role="button" data-icon="arrow-r" data-iconpos="right">Google</a>

Log Output

Resetting plugins due to page load.
Finished load of: https://www.google.ch/?gws_rd=cr&ei=hj31Up7fEYXgygXXXXXXXX
like image 244
Samuel Wicky Avatar asked Mar 21 '23 15:03

Samuel Wicky


1 Answers

Just found the solution.

The following entry was missing in the iOS cordova_plugins.js File. In Android it was available....

{
    "file": "plugins/org.apache.cordova.core.inappbrowser/www/InAppBrowser.js",
    "id": "org.apache.cordova.core.inappbrowser.InAppBrowser",
    "clobbers": [
        "window.open"
    ]
},
like image 156
Samuel Wicky Avatar answered Apr 01 '23 16:04

Samuel Wicky