Cordova 3.0 - Open link in external browser in iOS

前端 未结 2 711
挽巷
挽巷 2021-02-05 13:56

How do you open links in the devices native browser when using Cordova 3.0 on iOS?

People have suggested using window.open( url, \"_system\" ) but this does

2条回答
  •  佛祖请我去吃肉
    2021-02-05 14:45

    install InAppBrowser plugin:

    $ cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser.git
    $ cordova plugin rm org.apache.cordova.core.inappbrowser
    

    and execute the plugin in your .js file:

    //exec(successCallback, errorCallback, pluginName, pluginMethod, params)
    cordova.exec(null, null, "InAppBrowser", "open", [url, "_system"]);
    

提交回复
热议问题