10
votes

We have some in-house apps and before iOS 9, the apps will open a link like "itms-services://" after version compare, the new version apps will be downloaded and install.

But after we tested on iOS 9, we found the apps cannot open the link "itms-services://" link, got error like "LaunchServices: ERROR: There is no registered handler for URL scheme itms-services"

The code we used to update the app:

let downloadUrl = NSURL(string: url)
UIApplication.sharedApplication().openURL(downloadUrl!)

We have tested put "itms-services", "itms-services://" and the full URL into "LSApplicationQueriesSchemes" in plist file. But still not work.

4
Have got the workaround method for this issue. Configure a sub-domain name on an domain and set the new URL to redirect to itms-service:// URL automatically (your DNS service provider always support this), in the app, open the new URL instead of "itms-service" URL, got this from app forum, not tested yet. - Daniel

4 Answers

1
votes

I have come to the same problem with you. And I solve this problem with the method that the app open a html url with safari first,

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http:// xx.xx.xx.xx/xx.html"]];

the html url redirect to the url --- itms-services://?action=download-manifest&url=https://xx.xx.xx.xx/xx/xx.plist address. Though this method can update my app, but the update process need open Safari first and then alert open App Store, if you select open button then it will alert whether install your app, at last you confirm install button. the app will be installed automatically.

my html content as follow:

<html>
<head>
<metahttp-equiv="Content-Type" content="text/html;charset=utf-8" />
     <script type="text/javascript">
               function load()
               {
                        window.location ="itms-services://?action=download-manifest&url=https://xxx/xx/xx.plist";
               }
     </script>
</head>
<body onload = "load()">
0
votes

In iOS9 (in my case my url scheme is: hash:)

Change info.plist: add the custom url schemes here

then register event handler in appdelegate:

 func application(app: UIApplication, openURL url: NSURL, options: [String : AnyObject]) -> Bool {
    // do what you want to do
    print(url);

    // return true if url matches scheme
    return true;
}
0
votes

Don't know it it's your case but you need an https url to download the apps. We don't have an SSL on our website so what we do is upload the .plist to dropbox and use the shared link in the itms-services link. The .plist redirects to your server and we don't have problems

0
votes

In iOS 9 you must whitelist any URL schemes your App wants to query in Info.plist under the LSApplicationQueriesSchemes key (an array of strings):

enter image description here

With the schemes included in Info.plist everything works as before. When you link against iOS 9 you are not limited to 50 distinct schemes you just need to declare what you need in Info.plist. There seems to be no limit for how many schemes you can include but I would expect questions from the App Store review team if they think you are abusing the mechanism.

Note that this mechanism only applies to canOpenURL and not openURL. You do not need to have a scheme listed in Info.plist to be able to open it with openURL.

More information at : http://useyourloaf.com/blog/querying-url-schemes-with-canopenurl.html