手机浏览器_安卓_苹果手机Webview 中唤醒APP
2017-09-07 15:53
483 查看
Url scheme是iOS,Android平台都支持,只需要原生APP开发时注册scheme, 那么用户点击到此类链接时,会自动跳到APP。比如
<!-- 打开考拉APP首页 -->
<a href="kaola://www.kaola.com">打开APP</a>
<!-- 呼叫号码 -->
<a href="tel://13788889999">打开拨号</a>
以下是各大APP的scheme
微信无法打开或者下载,打开APP这个基本无解,下载则只能让应用进驻应用宝市场,然后检测到在微信中运行时,跳转到应用宝页面下载或者提示用浏览器打开页面唤醒APP。
如果想加载页面就判断有没有安装则执行以下代码:
<!-- 打开考拉APP首页 -->
<a href="kaola://www.kaola.com">打开APP</a>
<!-- 呼叫号码 -->
<a href="tel://13788889999">打开拨号</a>
以下是各大APP的scheme
//1、淘宝:“taobao://” //2、支付宝:“alipays://platformapi/startapp?appId=20000067&url=”,20000067 代表钱包内部应用的ID //3、天猫:“tmall://page.tm/webview?webURLString=” //4、淘宝电影:“tbmovie://taobao.com/h5jump?url=”
微信无法打开或者下载,打开APP这个基本无解,下载则只能让应用进驻应用宝市场,然后检测到在微信中运行时,跳转到应用宝页面下载或者提示用浏览器打开页面唤醒APP。
如果想加载页面就判断有没有安装则执行以下代码:
<script> function makeHiddenIframe(url) { var ua = navigator.userAgent.toLowerCase(); if( ua.match(/iphone os 9/i) == "iphone os 9" ) { window.setTimeout(function() {location.href = url;},100); }else{ var ifa = document.createElement('iframe'); ifa.style.display = 'none'; ifa.src = url; document.body.appendChild(ifa); var openTime = +new Date(); window.setTimeout(function(){ document.body.removeChild(ifa); if( (+new Date()) - openTime > 2500 ){ location.href = url; } },2000); } } makeHiddenIframe('saaslunch://btdai/haha'); </script>
相关文章推荐
- 从浏览器或者Webview 中唤醒APP
- 不使用webview,用手机浏览器的android app
- JS唤醒Android APP(包括在外部浏览器和WebView)
- JS唤醒Android APP(包括在外部浏览器和WebView)
- 不使用webview,用手机浏览器的android app
- 从浏览器或者Webview 中唤醒APP
- 从浏览器或者Webview 中唤醒APP
- JS唤醒Android APP(包括在外部浏览器和WebView)
- webView打开的页面和手机浏览器打开的不一样
- 安卓原生APP内嵌webview调试
- 用WebView或手机浏览器打开连接问题
- 安卓与Vue交互—————WebView加载Vue App返回键的控制
- 通过H5(浏览器/WebView/其他)唤起本地app
- 安卓WebView中接口隐患与手机挂马利用(远程命令执行)
- 安卓WebView中接口隐患与手机挂马利用(远程命令执行)
- [一个星期自学安卓]手机网页空间WebView
- 移动开发:使用桌面chrome调试安卓设备上的chrome和cordova app(webview)
- 【安卓小技巧】WebView设置在本页面打开网页,而不是启动浏览器打开
- Web调用安卓,苹果手机摄像头,本地图片和文件
- 【安卓-自定义布局】安卓App开发思路 一步一个脚印(十)实现内嵌在app中的webview 腾讯开源X5 高效安全