zoukankan      html  css  js  c++  java
  • js调用app启动页

    第一步:添加js

    $(function () {
    var ua = window.navigator.userAgent.toLowerCase();
    //微信
    if(ua.match(/MicroMessenger/i) == 'micromessenger'){
         //微信浏览器绑定事件
    /*$(".app").bind('click', function (event) {
    window.location.href = '';
    })*/
    }else{//非微信浏览器
    if (navigator.userAgent.match(/(iPhone|iPod|iPad);?/i)) { //iPhone|iPod|iPad浏览器
                $(".app").bind('click', function (event) {
    var loadDateTime = new Date();
    window.setTimeout(function () {
    var timeOutDateTime = new Date();
    if (timeOutDateTime - loadDateTime < 5000) {
    window.location = "http://itunes.apple.com/app/1219885292";//ios下载页面
    } else {
    window.close();
    }
    }, 25);
    window.location = "YuWan://com.YuWan.DianJingPingTai"; //调用ios启动页地址
    })
    }else if (navigator.userAgent.match(/android/i)) { //安卓浏览器
    $(".app").bind('click', function (event) {
    var state = null;
    try {
    window.location = 'appshare://bluemobi.cn.esport'; //调用andriod启动页地址
                        setTimeout(function(){
    window.location= "download.html"; //android下载页面

    },500);
    } catch(e) {}
    })
    }

    }
    })

    第二步:请andriod人员配置一下参数 apps custom url schemes

    http://blog.csdn.net/xc765926174/article/details/51397847

    第三步:请ios人员配置一下参数apps custom url schemes

    http://blog.csdn.net/ba_jie/article/details/6884818

  • 相关阅读:
    oracle 安装
    C++中 接口的定义 COM
    linux查看及改变运行级别
    BSD Apache GPL LGPL MIT
    DES MAC PIN HEX
    c语言字符输出格式化
    oracle
    Windows C++ 子目录数量
    GetProcAddress 宏
    How do I install Adobe Flash on Debian Wheezy?
  • 原文地址:https://www.cnblogs.com/lynna/p/6992131.html
Copyright © 2011-2022 走看看