[英]How to set correct content-type for apple-app-site-association file on Nginx/Rails
[英]The correct content-type is set, but i the .ipa File is treated like a .zip File
我编写了一个小型 Rails 应用程序,我可以在其中上传三个文件,我需要这些文件以无线方式分发临时构建。 这包括一个.ipa文件、一个.mobileprovisioning文件和一个.plist文件。
现在的问题是,当我单击.ipa文件的链接时,文件被视为正常下载,我的 iDevices 询问我将文件存储在哪里。
curl -I example.com/path/to/App.ipa
生成此输出
HTTP/1.1 200 OK
Date: Thu, 25 Oct 2012 13:55:08 GMT
Cache-Control: public, max-age=0
Last-Modified: Thu, 25 Oct 2012 10:23:07 GMT
ETag: "742-1351160587000"
Content-Type: application/octet-stream
Accept-Ranges: bytes
Content-Length: 742
Connection: keep-alive
我认为application/octet-stream是正确的内容类型。 我究竟做错了什么?
预先感谢您的回答
问候, 布克
.ipa 文件只是一个(不是很好伪装的)zip 文件(它只是重命名为.ipa
)。 也许当您设置通用的application/octet-stream
MIME-type 时,iOS 上的 Safari 浏览器会查看文件的实际内容,发现它实际上是一个 ZIP 存档并继续。 顺便说一句,在我看来,您希望对 iOS 应用程序进行一些内部或临时分发。 在这种情况下,您应该真正将用户引导至 manifest.plist 文件(以itms-services://
开头的 URL),以便 iOS 知道它需要查找应用程序包,然后下载并安装它。
请按照以下步骤操作:
<?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://www.anysite.com/application/your_app.ipa</string>
</dict>
</array>
<key>metadata</key>
<dict>
<key>bundle-identifier</key>
<string>com.example.helloworld</string>
<key>bundle-version</key>
<string>1.0.0</string>
<key>kind</key>
<string>software</string>
<key>title</key>
<string>App Name</string>
</dict>
</dict>
</array>
</dict>
</plist>
将“ bundle-identifier ”和“ title ”替换为您的值。
<a href="itms-services://?action=download-manifest&url=https://www.anysite.com/application/your_app.plist">
Download
</a>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.