Question

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)"

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top