PhoneGap: Open external link in default browser (outside the app)

前端 未结 16 1701
我在风中等你
我在风中等你 2020-12-09 15:36

I\'m trying to open links in Safari (on an iPhone) from a PhoneGap application. I\'m using PhoneGap version 3.1.0, and use PhoneGap Build, to build the application.

16条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-09 16:10

    I am using the cordova 6.0, here is my solution:

    1: Install this cordova plugin.

    cordova plugin add cordova-plugin-inappbrowser
    

    2: add the open link in the html like following.

    Google
    

    3: this is the most importaint step due to this I faced lots of issue: download the cordova.js file and paste it in the www folder. Then make a reference of this in the index.html file.

    
    

    This solution will work for both the environment android and iPhone.

提交回复
热议问题