2015-06-29 64 views
0

我期待在應用程序更新中創建,目前我的應用程序在我的亞馬遜是s3存儲桶中爲我的plist文件創建一個簽名url,我還爲我創建了一個簽名url .ipa文件,並存儲在我的plist文件已簽署的網址,如可以在下面看到:正在下載從亞馬遜Aws s3應用程序更新OTA iOS

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是已簽署的網址添加到項目的服務://?動作等。

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> 

當您將它們插入瀏覽器時,這些網址正在工作,但是,應用程序不會像點擊鏈接時那樣下載應用程序。

我已經嘗試過在plist中編碼URL的url無濟於事。 plist中有內容類型:text/plain的 的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> 

我希望這可以幫助別人的未來。