javascript - js怎么识别app是否已安装?
本文介绍了javascript - js怎么识别app是否已安装?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问 题
$(".a").click( function (){
var agentUser = navigator.userAgent;
if (agentUser.indexOf('iPhone')>-1 || agentUser.indexOf('iPod')>-1 || agentUser.indexOf('iPad')>-1) {
$(this).prop('href','KingTalentApp://')
window.setTimeout(function () {
window.location.href = 'itms-apps://itunes.apple.com/us/app/jin-ying-jie/id1184103156?l=zh&ls=1&mt=8';
}, 1000);
}
else if( agentUser.indexOf('Android')>-1 || agentUser.indexOf('Lindex')>-1)
{
$(this).prop('href','jinyingjie://app.jinyingjie')
window.setTimeout(function () {
window.location.href = 'http://www.jinyingjie.com/Uploads/jinyingjie.apk';
}, 1000);
}
})
在网上找的代码 苹果没有问题 但是安卓手机总是有些机型识别不了
解决方案
这个是基本的 URL Scheme
:APPNAME://xxx
,之前测试没碰到不能触发的
要么你是在 微信,微博等里webview测试了?可能会被拦截
这篇关于javascript - js怎么识别app是否已安装?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文