这里只介绍URL Schemes这种方式。
客户端:
新建一个Scheme,并把写一个与网页端通信的scheme。如下,我定义了tempscheme。然后就完成了,就是这么简单。
image.png
网页端:
只需要写个JS就行了,核心代码如下
if (isiOS) {
var ios_href = "https://xxxxx";//写你的下载地址,APPStore或者蒲公英之类的
window.location = "weilaishangshi://" //进入直接打开应用
setTimeout(function () {//如果打开超时
document.querySelector('#iosApp').href = ios_href;
}, 600)//超时时间
}