问题
External URLs don't open in the system's browser in my PhoneGap IOS application. I'm using PhoneGap Build 2.7.0.
Javascript:
window.open(myURL, '_blank', 'location=yes');
Config.xml
<plugins>
<plugin name="InAppBrowser" value="CDVInAppBrowser" />
</plugins>
<access origin="*" />
How to solve this? when i using the url "www.google.com" it works fine but when i used required url for my app it did not worked even that url works fine in browser.
回答1:
Javascript:
myURL = encodeURI(myURL);
window.open(myURL, '_blank', 'location=yes');
Using of encodeURI method fix the above issue
回答2:
Take reference from this link. I have used this plugin for my IOS application development way back. It works like a charm. Also, it is easy to integrate.
Hope it helps !
来源:https://stackoverflow.com/questions/17569787/phonegap-app-external-url-dont-open-in-inapp-browser-of-ios