Phonegap App : External URL don't open in InApp Browser of IOS

南楼画角 提交于 2019-12-30 06:59:26

问题


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

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