H5唤起应用商店或者应用市场
生活随笔
收集整理的這篇文章主要介紹了
H5唤起应用商店或者应用市场
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
常用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.xxvivo應用商店:
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 linkwindow.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 = nulltry {window.location = 'usp:xxxxx' //schema鏈接或者universal linkwindow.setTimeout(function () {window.location = 'https:xxxxxxx' //android下載頁面}, 500)} catch (e) { }}}// 點擊下載地址,有上架手機商店的直接打開應用商店,沒有上架商店打開下載地址const download = () => {var u = navigator.userAgentif (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' // 下載地址}}}總結
以上是生活随笔為你收集整理的H5唤起应用商店或者应用市场的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: linux 安装tomcat教程(配图详
- 下一篇: python怎么算圆的面积公式_【Pyt