iOS / Cordova: InAppBrowser not working

前端 未结 3 1945
逝去的感伤
逝去的感伤 2021-02-06 17:19

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 webpa

相关标签:
3条回答
  • 2021-02-06 17:58

    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)

    0 讨论(0)
  • 2021-02-06 18:00

    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.

    0 讨论(0)
  • 2021-02-06 18:12

    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"
        ]
    },
    
    0 讨论(0)
提交回复
热议问题