Over the Air iOS Adhoc Build using Relative URL
Asked Answered
M

1

10

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

Monsignor answered 26/2, 2013 at 5:37 Comment(0)
E
9

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.

Encephalitis answered 17/9, 2013 at 19:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.