'Downloading App update OTA from Amazon Aws s3 iOS

I'm looking to create in app updates, currently my app creates a signed url for my plist file in my Amazon was s3 bucket, I've also created a signed url for my .ipa file and stored that signed url in my plist file, as can be seen below:

URL Call in App:

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]];

where ipaDownloadString is a signed url appended to item-services://?action etc.

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>

The urls are working when you plug them into a browser however, the app won't download the app as it should when the link is clicked.

I have tried url encoding the url in the plist to no avail. The plist has content-type: text/plain the ipa has content-type |: application/octet-stream

cheers, ben



Solution 1:[1]

I solved this myself, for those who need this information in the future:

The url in the plist file needs to be signed and and the '&''s in said url need to be encoded in the form & .

I have found the content-type on s3 has no being on the issue at all.

I have included a sample 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>

I hope this helps someone in the future.

Solution 2:[2]

In my case, I replaced & with &#38;

If I use & with &amp; it did not work.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ben
Solution 2 ru-rocker