How to open iTunes link with inappbrowser?

巧了我就是萌 提交于 2019-12-08 02:09:36

问题


I've got inappbrowser working in my Cordova 2.8 app except that links to iTunes, like this:

<p><a href="#" onclick="window.open('https://www.itunes.apple.com/us/app/apppname', '_blank', 'location=yes,enableViewPortScale=yes');">open</a></p>

do not open - can anyone help me out and explain how to fix this? (all other URL's open fine).


回答1:


Try to use encodeURI() method with your URL. I think it will resolve your problem

<a href="#" onclick="window.open(encodeURI('itms-apps://itunes.apple.com/us/app/google-maps/id58502735‌​4?mt=8&uo=4'), '_blank', 'location=yes,enableViewPortScale=yes');">Open</a>

Check out this post Phonegap App : External URL don't open in InApp Browser of IOS




回答2:


You should use itms-apps://www.itunes.apple.com/us/app/apppname It'll open the link in the iTunes app.




回答3:


The latest version of the plugin has solved this problem!

v 1.4



来源:https://stackoverflow.com/questions/17213927/how-to-open-itunes-link-with-inappbrowser

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