H5唤醒App
-
安装依赖
npm install --save callapp-lib
-
引入 callapp-lib
import CallApp from "callapp-lib";
-
使用 callapp-lib
<button @click="onApp">打开app</button> //唤醒App callLibFn() { this.options = { scheme: { //打开IOS的标识 protocol: 'huoluApp', }, intent: { //打开安卓标识 package: 'com.wanjie.firedeer', //安卓协议 com.tencent.mm weixin scheme: 'huoluApp', }, appstore: 'https://apps.apple.com/cn/app/%E7%81%AB%E9%B9%BF/id1449119083', //App Store地址 yingyongbao: 'https://android.myapp.com/myapp/detail.htm?apkName=com.wanjie.firedeer&ADTAG=mobile', //应用宝地址 fallback: 'https://www.ihuolu.com/#/down-load', //唤端失败后跳转的地址。 timeout: 2000, //等待唤端的时间(单位: ms),超时则判断为唤端失败。 } this.callLib = new CallApp(this.options); }, onApp(){ this.callLib.open({ path: '' }); uni.showLoading({ title: '正在打开App...' }); }