IOS / Cordova: InAppBrowser not working

I am creating an application for Android and iOS using Cordva (v3.3.0) and JQuery Mobile. Now I am trying to use the InAppBrowser plugin. On Android, this works great, but on iOS, the webpage seems to open in the Cordoba WebView, and not in the system browser. The problem is that it is not possible to return to the application as soon as the browser opens, because the location / return button is missing.

I already tried to remove the plugin and add it again, and also updated Cordoba to the latest version (3.3.0)

Can someone help me find a bug?

Thank!

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
+3
source share
3 answers

Just found a solution.

iOS cordova_plugins.js . Android ....

{
    "file": "plugins/org.apache.cordova.core.inappbrowser/www/InAppBrowser.js",
    "id": "org.apache.cordova.core.inappbrowser.InAppBrowser",
    "clobbers": [
        "window.open"
    ]
},
+4

<meta http-equiv="Content-Security-Policy" content="img-src * 'self' data:; default-src * 'self' gap: wss: ws: ; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval';">

.

+1

For me, the problem was with Visual Studio Cordova tools. I updated the Cordova CLI to 5.1.1, but in visual studio config.xml> the Platform section I still had 4.3.3. Therefore, when I used the last inappbrowser with the new name cordova-plugin-inappbrowser, it did not work.

So, if you are using Visual Studio, make sure that the version in the config.xml file matches the command line. (use the cord version to get the correct version)

0
source

All Articles