实现在iphone,ipod,ipad网页中点击下载安装ipa文件示例

实现在iphone,ipod,ipad网页中点击下载安装ipa文件示例
ipa文件在台式机与iphone,ipad,ipod的不同处理方式,网页示例实现ipa文件下载安装
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title></title>
</head>
<body>
</body>
</html>
<script type="text/javascript" src="js/zepto.min.js"></script>
<script>

    $(function(){
        if(isAppleDevice()){
            //alert("是苹果设备");
            window.document.location="itms-services://?action=download-manifest&url=https://d6rta13euiapg2d5.cloudfront.net/ipas/myapp/myapp.plist";
        }else{
            //alert("不是苹果设备");
            window.document.location="http://www.example.com/myapp.ipa";
        }
    });


    //判断是否苹果设备
    var isAppleDevice = function(){
        return (/iphone/i.test(navigator.userAgent))||(/ipad/i.test(navigator.userAgent)||(/ipod/i.test(navigator.userAgent)));
    };

</script>

the end

热门文章