ios - itms-service 能不能用php动态生成xml安装?

WBOY
Release: 2016-06-06 20:40:42
Original
2015 people have browsed it

我写了个前端页面(https://pg.xlss.in/ipa/),用来分发ios程序的。目的是想用php动态生成plist字符串,直接返回给浏览器,然后手机安装对应的ipa。

测试网址:https://pg.xlss.in/ipa/test.html (ipa文件写的是内网地址)

用了一个实体.plist文件,安装正常;
itms-services://?action=download-manifest&url=https://pg.xlss.in/ipa/test.plist

用我php根据参数生成的xml,不成功。
itms-services://?action=download-manifest&url=https://pg.xlss.in/ipa/plist.php?ver=2.0.0&env=predist

xml和实体plist的内容一模一样

回复内容:

我写了个前端页面(https://pg.xlss.in/ipa/),用来分发ios程序的。目的是想用php动态生成plist字符串,直接返回给浏览器,然后手机安装对应的ipa。

测试网址:https://pg.xlss.in/ipa/test.html (ipa文件写的是内网地址)

用了一个实体.plist文件,安装正常;
itms-services://?action=download-manifest&url=https://pg.xlss.in/ipa/test.plist

用我php根据参数生成的xml,不成功。
itms-services://?action=download-manifest&url=https://pg.xlss.in/ipa/plist.php?ver=2.0.0&env=predist

xml和实体plist的内容一模一样

已经解决。可以不需要实体plist文件。之前不成功的原因是:

itms-services://?action=download-manifest&url=https://pg.xlss.in/ipa/plist.php?ver=2.0.0&env=predist

url后的网址未进行urlencode

解决方式:

最后一个 url 后的网址需要对参数部分进行urlencode,范例:

<code>$scope.install = function(){
    var url = 'https://pg.xlss.in/ipa/plist.php';
    var params = '?ver=' + $scope.data.version + '&env=' + $scope.data.environment;
    encodeParams = encodeURIComponent(params);
    window.location.href = 'itms-services://?action=download-manifest&url=' + url + encodeParams;
};
</code>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!