标签:item 缓存 image 不能 row replace 安装过程 ring html
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
最后,使用方式:
window.location = "itms-services:///?action=download-manifest&url=https://html.主域名.com/company_ios/propertylist.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/包.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>
关于跳转设置信任的逻辑:
iOS 9 版本之前可以直接: prefs:root=General&path=ManagedConfigurationList
iOS 10 系统之后不能直接跳转了,但是可以: https://www.主域名.com/企业签文件.mobileprovision
JS Demo:
var agent = navigator.userAgent.toLowerCase() ; if(agent.indexOf("like mac os x") > 0){ var ver=agent.match(/cpu iphone os (.*?) like mac os/); ver = ver[1].replace(/_/g,".") ver = ver.split(‘.‘)[0] var url = "prefs:root=General&path=ManagedConfigurationList"; if (agent.indexOf(‘ipad‘) > 0 || ver > 9) { if (agent.indexOf(‘browser‘) < 0) { //证书替换 url = "https://www.xnqdapp.com/embedded_2019010201.mobileprovision"; } }else { } this.doLocation(url); }
标签:item 缓存 image 不能 row replace 安装过程 ring html
原文地址:https://www.cnblogs.com/Mr-Lim/p/10247077.html