常用APP URL Scheme
常用app
App Store:
scheme: 'itms-apps://'
支付宝:
packageName: 'com.eg.android.AlipayGphone',
scheme: 'alipay://'
淘宝:
packageName: 'com.taobao.taobao',
scheme: 'taobao://'
QQ:
packageName: 'com.tencent.mobileqq',
scheme: 'mqq://'
微信:
packageName: 'com.tencent.mm',
scheme: 'weixin://'
京东:
packageName: 'com.jingdong.app.mall',
scheme: 'openApp.jdMobile://'
新浪微博:
packageName: 'com.sina.weibo',
scheme: 'sinaweibo://'
苏宁:
scheme: 'suning://'
优酷:
packageName: 'com.youku.phone',
scheme: 'youku://'
应用商店
小米应用商店:
scheme: "mimarket://details?id=com.xx.xx"
三星应用商店:
scheme: "samsungapps://ProductDetail/com.xx.xx"
华为应用商店:
scheme: "appmarket://details?id=com.xx.xx"
OPPO应用商店:
oppomarket://details?packagename=com.xx.xx
vivo应用商店:
scheme: "vivomarket://details?id=com.xx.xx"
react示例如下
const installApp = () => {
if (navigator.userAgent.match(/(iPhone|iPod|iPad);?/i)) {
var loadDateTime = new Date()
window.location = 'https://xxxxxxx' //schema链接或者universal link
window.setTimeout(function () {
//如果没有安装app,便会执行setTimeout跳转下载页
var timeOutDateTime = new Date()
if (timeOutDateTime - loadDateTime < 5000) {
window.location = 'https://xxxxxxx' //ios下载页面
} else {
window.close()
}
}, 500)
} else if (navigator.userAgent.match(/android/i)) {
var state = null
try {
window.location = 'usp:xxxxx' //schema链接或者universal link
window.setTimeout(function () {
window.location = 'https:xxxxxxx' //android下载页面
}, 500)
} catch (e) { }
}
}
// 点击下载地址,有上架手机商店的直接打开应用商店,没有上架商店打开下载地址
const download = () => {
var u = navigator.userAgent
if (u.indexOf('iPhone') > -1) {
//苹果手机
window.location.href = 'https:xxxxxx' //ios下载地址
} else {
if (u.match(/(vivo|VIVO);?/i)) {
window.location.href = "vivomarket://details?id=com.xxxxx" // vivo手机 com.xxxx包名
} else if (u.match(/(OPPO|oppo);?/i)) {
window.location.href = "oppomarket://details?packagename=com.xxxxxx" // oppo手机
} else if (u.match(/(HUAWEI|HONOR);?/i)) {
window.location.href = "appmarket://details?id=com.xxxxx" // 华为手机
} else {
//安卓其他设备
window.location.href = 'https:xxxxxxx' // 下载地址
}
}
}