iOS和Android手机浏览器链接打开app store或应用市场下载软件
1.Android主流手机跳转链接
// androidId 如:com.xxx.app
// oppo
oppomarket://details?packagename=' + androidId
// huawei
'appmarket://details?id' + androidId
// xiaomi
'mimarket://details?id=' + androidId
// vivo
'vivomarket://details?id=' + androidId
// samsung
'samsungapps://ProductDetail/' + androidId
// other
'market://details?id=' + androidId;
2.判断手机类型
function initMobileType() {
let userAgent = navigator.userAgent
if (userAgent.includes('iphone')) {
return 'iphone';
} else if (userAgent.includes('huawei') || userAgent.includes('honor')) {
return 'huawei';
} else if (userAgent.includes('mi') || userAgent.includes('mix') || userAgent.includes('redmi')) {
return 'xiaomi';
} else if (userAgent.includes('vivo')) {
return 'vivo';
} else if (userAgent.includes('sm')) {
return 'samsung';
} else if (userAgent.includes('pacm00') || userAgent.includes('oppo')) {
return 'oppo';
} else {
return 'default'
}
}
3.iOS跳转app store
// iosId 如:id1640184175
window.location.href='https://apps.apple.com/cn/app/dsoon/' + iosId
文章来源地址https://www.toymoban.com/news/detail-501984.html
文章来源:https://www.toymoban.com/news/detail-501984.html
到了这里,关于iOS和Android手机浏览器链接打开app store或应用市场下载软件的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!