Wechat jump browser prompt, 366API analysis how to directly jump to mobile phone default browser in wechat browser

Keywords: iOS Mobile Javascript JQuery Android

Many friends' APP promotion links need to be publicized, propagated, downloaded and so on in wechat, but you must have found that the download links of APP are blocked in wechat. But wechat is the biggest social platform. For its own benefit, it blocks all APK download links. How can we solve this problem?

Solution:

Based on wechat interface, we have developed a new APP download program for wechat on mobile phone. If Android users click the link generated by this program, they can directly jump to the default browser of mobile phone to open the download link. If IOS users click on wechat, a mask will pop up to prompt users to open the download link with their browser or jump to Apple's APP store. In this way, the user's operation steps are greatly reduced, and the so-called bundle download of wechat will not appear with our method. To provide users with a good download experience will significantly improve our promotion conversion rate.

Share a source code for your reference:

<!DOCTYPE html>
<html xmlns="http://www.366api.cn/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>loading</title>
        <script type=text/javascript src="http://libs.baidu.com/jquery/1.9.0/jquery.min.js"></script>
    </head>
    
    <body>
        
        
    <script type="text/javascript">
        $(function () {
            get_share();
        });
        
        function get_share(){
            var user = getQueryString('user');
            var url = getQueryString('url');
            $.ajax({
             type: "get",
             async: false,
             url: 'http://api.weixin139.com/jumpurl/index/get_url.html',
             data:{user:user,url:url},
             dataType: "jsonp",
             jsonp: "callback",
             jsonpCallback:"checkHandler",
             success: function(data){
                 window.location.href=data.url;
             },
         });
        }
        
        function getQueryString(name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
            var r = window.location.search.substr(1).match(reg);
            if (r != null) return unescape(r[2]);
            return null;
        }
 
        </script>
 
    </body>
</html>

Posted by alphamic on Sun, 03 Nov 2019 03:45:20 -0800