正在从 Amazon Aws s3 下载应用程序更新 OTA iOS

Downloading App update OTA from Amazon Aws s3 iOS

我希望在应用程序更新中创建,目前我的应用程序在我的 Amazon was s3 存储桶中为我的 plist 文件创建了一个签名的 url,我还创建了一个签名的 url我的 .ipa 文件并将签名 url 存储在我的 plist 文件中,如下所示:

URL 应用内调用:

NSMutableString *downloadURL = [NSMutableString string] ;
[downloadURL appendString:@"itms-services://?action=download-manifest&url="];
[downloadURL appendString:plistURL];
NSString *ipaDownloadString = [NSString stringWithString:downloadURL];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:ipaDownloadString]];

其中 ipaDownloadString 是已签名的 url 附加到 item-services://?action 等

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://bucket_name.s3-eu-west-1.amazonaws.com/ipa_name.ipa?AWSAccessKeyId=xxxxxxxxxxxxx&Expires=1435587320&Signature=xxxxxxxxxxxx</string>
</dict>
            </array>
    <key>metadata</key>
        <dict>
            <key>bundle-identifier</key>
            <string>com.name.DropboxTest</string>
            <key>bundle-version</key>
            <string>1.1</string>
            <key>kind</key>
            <string>software</string>
            <key>title</key>
            <string>Dropbox Test</string>
        </dict>
    </dict>
     </array>
</dict></plist>

当您将 url 插入浏览器时,它们可以正常工作,但是,当单击 link 时,应用程序不会按应有的方式下载应用程序。

我已经尝试 url 对 plist 中的 url 进行编码,但无济于事。 plist 的内容类型:text/plain ipa 的内容类型 |: application/octet-stream

干杯, 本

这个是我自己解决的,以后有需要的朋友:

plist 文件中的 url 需要签名,url 中的 '&' 需要编码为 & .

我发现 s3 上的内容类型根本没有问题。

我已经包含了一个示例 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>
        <!-- array of downloads. -->
        <key>items</key>
        <array>
            <dict>

                <!-- an array of assets to download -->
                <key>assets</key>
                <array>

                    <!-- software-package: the ipa to install. -->
                    <dict>

                        <!-- required.  the asset kind. -->
                        <key>kind</key>
                        <string>software-package</string>

                        <!-- required.  the URL of the file to download. -->
                        <key>url</key>
                        <string>https://s3-eu-west-1.amazonaws.com/bucket/path-to-ipa?AWSAccessKeyId=xxxxxxxxxxxxx&amp;Expires=1437661858&amp;Signature=xxxxxxxxxxxxxxxxxxxxxx</string>  

                    </dict>

                    <!-- display-image: the icon to display during download. -->
                    <dict>

                        <key>kind</key>
                        <string>display-image</string>

                        <key>url</key>
                        <string>link to image</string>
                    </dict>


                      <!-- full-size-image: the large 512×512 icon used by iTunes. -->
                    <dict>

                        <key>kind</key>
                        <string>full-size-image</string>


                        <key>needs-shine</key>
                        <true/>

                        <key>url</key>
                        <string>link to image</string>
                    </dict>
                </array>

                <key>metadata</key>
                <dict>

                    <!-- required -->
                    <key>bundle-identifier</key>
                    <string>com.hostname.appname</string>

                    <!-- optional (software only) -->
                    <key>bundle-version</key>
                    <string>1.2.5.0</string>

                    <!-- required.  the download kind. -->
                    <key>kind</key>
                    <string>software</string>

                    <!-- optional. displayed during download; -->
                    <!-- typically company name -->
                    <key>subtitle</key>
                    <string>Command Centre</string>

                    <!-- required.  the title to display during the download. -->
                    <key>title</key>
                    <string>Command Centre</string>
                </dict>
            </dict>
        </array>
    </dict>
</plist>

我希望这对以后的人有所帮助。

就我而言,我将 & 替换为 &

如果我将 && 一起使用,它不起作用。