微信中无法直接下载APP等文件的解决方案--强制跳转至浏览器打开
2019-03-07 16:19
821 查看
现在微信分享的功能很多,从分享的链接下载apk安卓包是很正常的,但是微信不让下载apk包,只能通过浏览器来下载,但是这要给用户一个提示吧,不然用户不知道
下面我们来实现,引导用户通过浏览器来下载apk包
看下效果,图片在最下面
在需要下载的页面中加入下面的代码
- <div class="weixin-tip" style="display:none;">
- <p>
- <img src="/images/weixin-tip.jpg" class="weixinpic" alt="微信打开"/>
- </p>
- </div>
css样式
- a{text-decoration: none;}
- .weixinpic{width: 100%; height: 100%;}
- .weixin-tip{display: none; position: fixed; left:0; top:0; bottom:0; background: rgba(0,0,0,0.8); filter:alpha(opacity=80); height: 100%; width: 100%; z-index: 100;}
- .weixin-tip p{text-align: center;}
js
- <script type="text/javascript" src="/js/jquery-1.7.2.min.js"></script>
- <script type="text/javascript">
- $(function(){
- var u = navigator.userAgent, app = navigator.appVersion;
- var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1;
- var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
- $('.img').click(function(){
- if(isAndroid){
- var winHeight = $(window).height();
- function is_weixin() {
- var ua = navigator.userAgent.toLowerCase();
- if (ua.match(/MicroMessenger/i) == "micromessenger") {
- return true;
- } else {
- return false;
- }
- }
- var isWeixin = is_weixin();
- if(isWeixin){
- $(".weixin-tip").css("height",winHeight);
- $(".weixin-tip").show();
- }else {
- window.location.href = "";//安卓下载地址
- }
- }else if(isIOS){
- location.href = '';//IOS下载地址
- }
- })
- })
- </script>
这要就可以下载了
相关文章推荐
- 微信中无法直接下载APP文件的解决方案--强制跳转至浏览器打开
- 微信中无法下载APP的解决方案(微信自动跳转浏览器打开下载链接)
- 微信中无法下载APP的解决方案(微信自动跳转浏览器打开下载链接)
- 微信中无法下载APP的解决方案(微信自动跳转浏览器打开下载链接)
- 微信浏览器无法下载App的解决方案 安卓微信跳转打开外部浏览器苹果跳转商店(App Store)
- 怎么让微信下载APK文件包,微信内置浏览器无法打开APP下载链接的解决方案
- 微信中无法下载APP的解决方案(微信自动跳转浏览器打开下载链接)
- 微信环境中不支持APP(APK)文件下载的解决方案---跳转到手机系统浏览器打开下载链接
- 微信中无法下载APP的解决方案(微信自动跳转浏览器打开下载链接)
- 微信环境中扫描二维码下载APP(APK)文件的解决方案-自动跳转到手机默认浏览器(AppStore)打开
- 微信中无法下载APP的解决方案(微信自动跳转浏览器打开下载链接)
- 微信中无法下载APP的解决方案(微信自动跳转浏览器打开下载链接)
- 安卓手机微信不能打开App下载地址的问题 微信实现点开网址直接跳转浏览器
- 微信分享链接网页下载的无法打开解决方案,微信跳转外部浏览器
- 微信无法下载APP的解决方案 : IOS自动跳转商店(App Store)安卓自动跳转手机默认浏览器下载
- 微信浏览器不支持下载文件或应用解决方案--跳转到默认浏览器打开
- 微信浏览器不支持下载文件或应用解决方案--跳转到默认浏览器打开
- 微信浏览器不支持下载文件或应用解决方案--跳转到默认浏览器打开
- 微信环境中如何实现下载apk文件的下载 扫描二维码跳转手机默认浏览器打开下载app的链接是怎么实现的
- 微信中怎么打开app文件 安卓微信跳转打开外部浏览器打开app文件下载链接(苹果无需上架跳转Apple Store下载)