I'd like to distribute my Beta Adhoc builds on my own server. There seems to be 2 important URLs in the logic Apple uses to install apps over the air.
The first url is in the HTML:
<p><a href="itms-services://?action=download-manifest&url=http://www.example.com.cn/path/to/plist/theplist.plist">Adhoc Build</a></p>
The second is inside that plist file
<dict>
<key>kind</key>
<string>software-package</string>
<key>url</key>
<string>http://www.example.com.cn/path/to/binary/app.ipa</string>
</dict>
Can those urls be relative? I'd like the same HTML and XML files to work on both my development machine (MAMP server), to test first that I can download the binary, then publish the adhoc build to my testers on my web server (NGINX). Currently I can only get it to work with an absolute url.
My thought is that these two relative URLs should work
<p><a href="itms-services://?action=download-manifest&url=/path/to/plist/theplist.plist">Adhoc Build</a></p>
and
<dict>
<key>kind</key>
<string>software-package</string>
<key>url</key>
<string>/path/to/binary/app.ipa</string>
</dict>
When I use those relative URLs I get a popup from the device when I click saying "Cannot connect to (null)"
Rather than including the entire URL for each page you link, relative URLs cut down on the workload and time needed. For example, coding /about/ is much faster than https://www.example.com/about .
Relative URLs are more convenient because they are shorter and often more portable. However, you can use them only to reference links on the same server as the page that contains them.
A URL specifies the location of a target stored on a local or networked computer. The target can be a file, directory, HTML page, image, program, and so on. An absolute URL contains all the information necessary to locate a resource. A relative URL locates a resource using an absolute URL as a starting point.
With HTTP or HTTPS requests, a relative URL can be processed by the web browser to fill in the missing details. The link to the .plist file is a custom URL scheme. Safari doesn't know the format of the URL, so it doesn't fill in any missing details. So that link must be an absolute URL. Safari just looks for something that can handle a itms-services URL scheme, and sends off the whole URL to that scheme.
The link to the .ipa file also must be absolute, not because the program that handles the itms-services URL scheme doesn't have enough information, but because that program doesn't run the logic built in to process the URLs. I'm guessing that Apple prefers to keep that code simple and reliable rather than add the relative URL feature.
One solution you have is to write some sort of server side processor of your HTML and PLIST files to produce rewritten files with absolute URLs based on the server. How you chose to get this done will depend upon the configuration of your servers.
Another solution is to keep the .plist and .ipa on the main webserver, use absolute URLs to that server, and work with your HTML file on both servers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With