我正在使用angularjs处理Web应用程序项目,它有移动应用程序,它们也是android和Ios。现在我想要在移动设备上打开Web应用程序时我需要找到设备类型并检查是否安装了移动应用程序,如果安装应该在移动应用程序中打开,如果没有下载按钮是app-link.Thanks in预先
答案 0 :(得分:1)
function checkOperatingSystem()
{ var userAgent = navigator.userAgent || navigator.vendor || window.opera;
//Check mobile device is Android
if (/android/i.test(userAgent)) {
//Add your Code here
}
//Check mobile device is IOS
if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) {
//Add your Code here
}
//Check device os is Windows (For Laptop and PC)
if (navigator.appVersion.indexOf("Win")!=-1)
{
//Add your Code here
}
//Check device os is MAC (For Laptop and PC)
if (navigator.appVersion.indexOf("Mac")!=-1)
{
//Add your Code here
}
}
答案 1 :(得分:0)
使用EXECUTIVE
服务,
你可以像这样检查
$window