【问题标题】:Downloading App update OTA from Amazon Aws s3 iOS从 Amazon Aws s3 iOS 下载应用程序更新 OTA
【发布时间】:2015-09-16 00:04:48
【问题描述】:

我正在寻找在应用程序更新中创建,目前我的应用程序在我的亚马逊是 s3 存储桶中为我的 plist 文件创建了一个签名的 url,我还为我的 .ipa 文件创建了一个签名的 url 并将该签名的 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 是附加到 item-services://?action 等的签名 url。

列表:

<?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>

当您将网址插入浏览器时,这些网址可以正常工作,但是,当点击链接时,应用程序不会像应有的那样下载应用程序。

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

干杯, 本

【问题讨论】:

    标签: ios amazon-s3 plist ipa


    【解决方案1】:

    我自己解决了这个问题,对于那些将来需要这些信息的人:

    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>
    

    我希望这对将来的人有所帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-12-06
      • 2019-07-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多