iOS 分发 - plist 的 itms-services 协议链接中的参数

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8881609/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 16:21:14  来源:igfitidea点击:

iOS distribution - parameters in itms-services protocol link for plist

iosplistprotected

提问by Pradeep

I would like to pass the userid and password in the itms-services link so that the protected plist can be accessed.

我想在 itms-services 链接中传递用户 ID 和密码,以便可以访问受保护的 plist。

To clarify, in the following link, the plist cannot be accessed directly as the access requires the userid and password to be entered so that plist is accessible.

澄清一下,在下面的链接中,不能直接访问 plist,因为访问需要输入用户名和密码,以便 plist 可以访问。

<a href="itms-services://?action=download-manifest&url=http://example.com/app.plist">

Currently the above link gives an error

目前上面的链接给出了一个错误

cannot connect to example.com

无法连接到example.com

回答by scooter133

I Was installing the IPA and PLIST on a Windows IIS Server.

我正在 Windows IIS 服务器上安装 IPA 和 PLIST。

I had to add MIME types for .ipa and .plist to the IIS Server for the iPad to be able to download the application.

我必须将 .ipa 和 .plist 的 MIME 类型添加到 iPad 的 IIS 服务器才能下载该应用程序。

For IIS, Open IIS Manager. Right click 'Server(local computer)'
Select Properties click 'MIME Types' Click 'New...'

对于 IIS,打开 IIS 管理器。右键单击“服务器(本地计算机)”
选择“属性”单击“MIME 类型”单击“新建...”

Add the Following MIME Types:

添加以下 MIME 类型:

.IPA   - application/octet-stream 
.PLIST -  text/plain.

回答by PerlDev

You'll need make sure the access to .plist and .ipa are accessible. We had auth cookie protection over the files, iTune could't install, exact same error "can't connect to mydomain.com". It finally worked by removing the security protection.

您需要确保可以访问 .plist 和 .ipa。我们对文件进行了 auth cookie 保护,无法安装 iTune,完全相同的错误“无法连接到 mydomain.com”。它最终通过删除安全保护起作用。

回答by James

For anyone who is interested in dynamically generating their plist, this example is PHP:

对于任何对动态生成 plist 感兴趣的人,这个例子是 PHP:

$appUrl='itms-services://?action=download-manifest&url=http://server/iOSpList.php?'.
                'url%3D'.$app['url'].
                '%26bundle%3D'.$app['bundle'].
                '%26version%3D'.$app['version'].
                '%26name%3D'.$app['name'];

Also, I believe the .plist mime type should be application/xml.

另外,我相信 .plist mime 类型应该是 application/xml.

回答by cregox

I had PHP on my server and couldn't access the server MIME configuration. So I did this:

我的服务器上有 PHP,无法访问服务器 MIME 配置。所以我这样做了:

app.plist.php

应用程序.plist.php

<?php
header('Content-type: application/xml');

$file = fopen("app.plist", "r");
while(!feof($file)){
    $line = fgets($file);
    print str_replace(".ipa", ".ipa.php", $line);
}
fclose($file);
?>

app.ipa.php

应用程序.ipa.php

<?php
header('Content-type: application/octet-stream');

$file = fopen("app.ipa", "r");
while(!feof($file)){
    $line = fgets($file);
    print $line;
}
fclose($file);
?>

For some reason, using readfiledidn't work. But this did.

出于某种原因,使用readfile不起作用。但这做到了。