推荐使用openinstall 初级版免费使用唤醒功能
除官方文档外的Vue集成:https://blog.csdn.net/qq_31754523/article/details/107342568
https://www.npmjs.com/package/callapp-lib
<!-- 优酷示例 具体参数查看官方文档 -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>唤醒app</title>
<style>
* {
margin: 0;
padding: 0;
}
body {
text-align: center;
}
#call-button {
display: inline-block;
margin-top: 50px;
padding: 10px;
border: 1px solid #000;
color: #c30;
cursor: pointer;
-webkit-tap-highlight-color: transparent;
}
</style>
</head>
<body>
<div id="call-button">点击唤起App</div>
<script src="./callapp-lib.js"></script>
<script>
const option = {
scheme: {
protocol: 'youku',
},
intent: {
package: 'com.youku.phone',
scheme: 'youku',
},
universal: {
host: 'acz-jump.youku.com/wow/ykpage/act/ulink',
pathKey: 'action',
},
appstore: 'https://itunes.apple.com/cn/app/id336141475',
yingyongbao: '//a.app.qq.com/o/simple.jsp?pkgname=com.youku.phone',
fallback: 'https://hudong.vip.youku.com/act/download.html',
timeout: 1000,
}
const lib = new CallApp(option)
const callButton = document.querySelector('#call-button')
callButton.addEventListener('click', () => {
lib.open({
path: '',
})
})
// 因为业务需要,我们需要添加 outChain 属性
// 但是这样生成出来的 scheme 稍显复杂,所以下面的 log 其实是移除了 outChain 属性的
// outChain 很少有同学会使用到,所以更方便大家理解
// ykshortvideo://profile
console.log(
lib.generateScheme({
path: 'profile',
})
)
// intent://profile#Intent;package=com.youku.shortvideo;scheme=ykshortvideo;S.browser_fallback_url=https%3A%2F%2Fdianliu.youku.com%2Fservice%2Fdownload;end;
console.log(
lib.generateIntent({
path: 'profile',
})
)
// https://flash-link.youku.com?action=profile
console.log(
lib.generateUniversalLink({
path: 'profile',
})
)
</script>
</body>
</html>
https://www.npmjs.com/package/web-launch-app
|