iOS / Cordova: InAppBrowser not working

两盒软妹~` 提交于 2019-12-03 08:57:06

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"
    ]
},

You should change page meta in header to

<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';">

It works for me.

For me the issue was with Visual Studio Cordova tools. I updated Cordova CLI to 5.1.1 however in visual studio config.xml > Platform section I still had 4.3.3. So when I used the latest inappbrowser with the new name cordova-plugin-inappbrowser is was causing it not to work.

So if you're using Visual Studio make sure the version in config.xml is the same as the command line. (use cordova -version to get the correct version)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!