APP发布系统ipa文件上传和下载itmsservice协议

编程

  1. 分为下载页面(dl.html)、text.plist文件、test.ipa文件地址
  2. .ipa文件上传到服务器 下载地址
  3. 生成plist文件xml格式上传到文件系统,返回下载地址
  4. 下载页面提供跳转链接

dl.html如下:

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<title>下载</title>

<script type="text/javascript">

function $G(){

var Url=top.window.location.href;

var u,g,StrBack="";

if(arguments[arguments.length-1]=="#")

u=Url.split("#");

else

u=Url.split("?");

if (u.length==1) g="";

else g=u[1];

if(g!=""){

gg=g.split("&");

var MaxI=gg.length;

str = arguments[0]+"=";

for(i=0;i<MaxI;i++){

if(gg[i].indexOf(str)==0) {

StrBack=gg[i].replace(str,"");

break;

}

}

}

return StrBack;

}

var id =$G("id");

if(!id){

alert("非法链接,缺少参数!");

}

var id =$G("id");

//api接口根据id参数动态生成xml

var url = "https://xxx.xxx./api/plist";

//这里是重点,必须要把index.php后面的所有参数进行encodeURIComponent编码才能有效

var en = encodeURIComponent("?id="+id);

url += en;

window.location.href = "itms-services://?action=download-manifest&url=" + url;

</script>

</head>

<body>

</body>

</html>

plist格式如下:

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

<plist version="1.0">

<dict>

<key>items</key>

<array>

<dict>

<key>assets</key>

<array>

<dict>

<key>kind</key>

<string>software-package</string>

<key>url</key>

<string>https://xxx.com/test.ipa</string>

</dict>

</array>

<key>metadata</key>

<dict>

<key>bundle-identifier</key>

<string>cn.vrv.im-inhouse</string>

<key>bundle-version</key>

<string>1.1</string>

<key>kind</key>

<string>software</string>

<key>subtitle</key>

<string>下载</string>

<key>title</key>

<string>安装</string>

</dict>

</dict>

</array>

</dict>

</plist>

注意plist地址和ipa文件地址是https地址https://xxx.com/test.ipa

发布出的地址https://xxx.com/dl.html?id=100 根据id动态去生成plist文件下载ipa进行安装

参考教程:

通过 itms:services://? 在线安装ipa ,跨过app-store https://www.cnblogs.com/sakura-panda/p/3628694.html

以上是 APP发布系统ipa文件上传和下载itmsservice协议 的全部内容, 来源链接: utcz.com/z/514355.html

回到顶部