2015-06-29 34 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> 

我希望这可以帮助别人的未来。