使用HTTPS下载IOS APP (in-House 下载APP)

发布时间:2016/10/25 0:29:57 打印 字号:

官方参考文章: http://help.apple.com/deployment/ios/#/apda0e3426d7

前提条件:

  1. 使用企业开发者帐号发布的APP ( 购买Apple企业开发者帐号 $299)

  2. 服务器已安装ssl证书, 可以使用https://www.gworg.com 访问自己的域名, 并且浏览器信任的SSL

  3. 目前个人开发者账号也可以下载(需要重新签名 绑定UDID)

一、 首先购买SSL证书  可以在会员中心自助购买

二、 安装SSL ,参照安装文档

三、 配置服务器 MIME 类型  ,将下面MIME类型添加到MIME列表中  (百度搜索MIME添加方法)

text/xml  plist
application/octet-stream  ipa

四、 在站点根目录新建一个app.html文件 ,添加一个A标签,(其他内容可以自己完成,这个只是实现最基本的下载)

<a  href="itms-services://?action=download-manifest&amp;url=https://www.gworg.com/app.plist">APP在线安装</a>

“itms-services”协议, 这个协议只有Safari浏览器支持 ,  plist的地址必须使用https://协议。

五、 制作 app.plist文件

  • URL应用 (.ipa) 文件的完全限定 HTTPS URL

  • display-image57 x 57 像素的 PNG 图像,在下载和安装过程中显示。指定图像的完全限定 URL

  • full-size-image512 x 512 像素的 PNG 图像,表示 iTunes 中相应的应用

  • bundle-identifier应用的包标识符,与 Xcode 项目中指定的完全一样

  • bundle-version应用的包版本,在 Xcode 项目中指定

  • title下载和安装过程中显示的应用的名称

<?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>http://www.gworg.com/app.ipa</string>
 </dict>
<dict>
<key>kind</key>
<string>display-image</string> 
<key>needs-shine</key>
<true/>
<key>url</key>
<string>https://www.gworg.com/image.57x57.png</string>
</dict>
<dict>
<key>kind</key>
<string>full-size-image</string> 
<key>needs-shine</key>
<true/>
<key>url</key>
<string>https://www.gworg.com/image.512x512.jpg</string>
</dict>
 </array>
 <key>metadata</key>
 <dict>
 <key>bundle-identifier</key>
 <string>cn.getssl.apptest</string>
 <key>bundle-version</key>
 <string>1.2.0</string>
 <key>kind</key>
 <string>software</string>
 <key>title</key> 
 <string>GetSSL</string>
 </dict>
 </dict>
 </array>
</dict>
</plist>

 

六、 用iPhone访问 html页面, 点击 安装APP

常见问题:

1 . 使用浏览器访问plist文件, 返回结果不是xml  ,  服务器没有添加MIME
2.  plist文件内容 很重要, 上面红色标记的地方必须填写正确。