iOS App蘋果企業籤分發 教程
阿新 • • 發佈:2019-01-09
1、必須有SSL證書(HTTPS)
企業籤分發的 plist、icon、ipa 等檔案下載連結必須是https協議的
例如:https://html.主域名.com/company_ios/propertylist.plist
2、配置MIME
如果是Nginx,在 nginx/conf/mime.types 配置檔案裡面新增如下配置
application/octet-stream ipa
text/xml plist
說明:
application/octet-stream表示.ipa字尾的檔案是下載型別的
text/xml表示.plist字尾的檔案是xml型別的
3、蘋果端安裝協議
itms-services:///?action=download-manifest&url=https://html.主域名.com/company_ios/propertylist.plist
最後,H5使用:
window.location = "itms-services:///?action=download-manifest&url=https://html.主域名.com/company_ios/propertylist.plist"
只要能夠觸發這個地址就好
注意:
- 自己簽名的SSL證書是不行的
- plist 檔案中有中文會有問題,需要另存為utf-8格式儲存即可
- plist 檔案下載路徑問題,下載路徑不要操作三級,否者會報“無法連線到...”、“此時無法下載...”、“證書有問題...”等
- 安裝協議 itms-services: 後面是三個"/",當然,我測試了兩個,也是可以的
- 客戶端對 plist 檔案是有快取的,如果安裝不成功,可以修改下 plist 檔名稱重新試下
- 安裝過程中圖片無法顯示問題,這個在plist檔案裡面已經設定了圖片地址,但是就是不顯示
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://www.主域名.com/xiNiuQD_hk_resigned.ipa</string> </dict> <dict> <key>kind</key> <string>full-size-image</string> <key>needs-shine</key> <true/> <key>url</key> <string>http://www.主域名.com/icon-512.png</string> </dict> <dict> <key>kind</key> <string>display-image</string> <key>needs-shine</key> <true/> <key>url</key> <string>http://www.主域名.com/icon-57.png</string> </dict> </array> <key>metadata</key> <dict> <key>bundle-identifier</key> <string>com.主域名.bundleId</string> <key>bundle-version</key> <string>2.0.0</string> <key>kind</key> <string>software</string> <key>subtitle</key> <string></string> <key>title</key> <string>App名稱</string> </dict> </dict> </array> </dict> </plist>