美文网首页
iOS基于item-services的APP自动升级方案(通过网

iOS基于item-services的APP自动升级方案(通过网

作者: Sh1mmer | 来源:发表于2019-01-25 11:00 被阅读0次

首先我们需要自己写一个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>ipa存放地址</string>
                </dict>
                <dict>
                    <key>kind</key>
                    <string>display-image</string>
                    <key>needs-shine</key>
                    <true/>
                    <key>url</key>
                    <string>一张57*57的png图片地址</string>
                </dict>
                <dict>
                    <key>kind</key>
                    <string>full-size-image</string>
                    <key>needs-shine</key>
                    <true/>
                    <key>url</key>
                    <string>一张512*512的png图片地址</string>
                </dict>
            </array>
            <key>metadata</key>
            <dict>
                <key>bundle-identifier</key>
                <string>app的bundleid</string>
                <key>bundle-version</key>
                <string>app的bundle-version</string>
                <key>kind</key>
                <string>software</string>
                <key>title</key>
                <string>下载标题</string>
            </dict>
        </dict>
    </array>
</dict>
</plist>
NSString *encodeURL = [你得plist存放地址 stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet characterSetWithCharactersInString:@"`#%^{}\"[]|\\<> "]];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"itms-services://?action=download-manifest&url=%@",encodeURL]]];

itms-services://?action=download-manifest&url=你得plist存放地址(要是https)
我这里出了个问题 发现display-image的图片不显示.如果有大神知道什么原因,希望能指点下

相关文章

网友评论

      本文标题:iOS基于item-services的APP自动升级方案(通过网

      本文链接:https://www.haomeiwen.com/subject/khkmjqtx.html