iOS和Android手機(jī)瀏覽器鏈接打開(kāi)app store或應(yīng)用市場(chǎng)下載軟件
1.Android主流手機(jī)跳轉(zhuǎn)鏈接
// 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.判斷手機(jī)類型
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跳轉(zhuǎn)app store
// iosId 如:id1640184175
window.location.href='https://apps.apple.com/cn/app/dsoon/' + iosId
文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-501984.html
文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-501984.html
到了這里,關(guān)于iOS和Android手機(jī)瀏覽器鏈接打開(kāi)app store或應(yīng)用市場(chǎng)下載軟件的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!