[iOS]JS判断有无安装App,安装了跳App,没安装跳网页。
作者:
imwudi | 来源:发表于
2016-11-24 10:57 被阅读153次
最近有个需求是要求在网页,点击一个链接,判断是否安装某个APP,安装了就跳App,没安装跳网页,在网上找了很多实例,都是安卓的可以用,iOS的不能用,最终找到这段能用的:
function goWebOrApp(){
var loadDateTime = new Date();
setTimeout(function () {
var timeOutDateTime = new Date();
if (!loadDateTime || timeOutDateTime - loadDateTime < 1210) {
window.location.href = "http://192.168.1.122/openApp/payResult.html";
}
}, 1200);
window.location.href = 'ebank2016725://';/* app's url scheme*/
}
【2016-11-24】
本文标题:[iOS]JS判断有无安装App,安装了跳App,没安装跳网页。
本文链接:https://www.haomeiwen.com/subject/cfsbpttx.html
网友评论