[UIApplication canOpenURL]?

Under iOS 9 the call [UIApplication canOpenURL:] will now result in the following message in the log:

-canOpenURL: failed for URL: "imdb:" - error: "This app is not allowed to query for scheme imdb"


This seems to be a new "security" feature which prevents that Apps can scan for installed Apps with known custom URL schemes. But this makes it impossible to ckeck if a certain App is installed. So there's no longer possible to hide all the options to open certain information in the other Apps if these Apps are not installed. This results to a bad user experience, because either I have to provide an option to open data in external Aps, even if these are not available, or I have to remove these options entirely. Both is not really very user friendly.


Is there a workaround for this? Is there a key for the Info.plist where I can request the permission for calling "canOpenURL" (similar to the key for the location services in order to be able to get geo locations)?

Accepted Reply

Watch session 703, "Privacy and Your Apps". These changes are covered in that session.

Replies

Watch session 703, "Privacy and Your Apps". These changes are covered in that session.

Thanks for pointing me to the right direction. I could solve my issue now.


For all developers having the same issue, the solution is to add a "whitelist" of all URL schemes your App may need to call into the Info.plist. The key to add is "LSApplicationQueriesSchemes" and its value is an array with all the URL schemes.

Of course this still kills many Apps which offer services to other Apps via "X-callback-URL" protocol, but at least this will work for many other Apps.

Thanks! Details at @ 10:00 into the video and Slide 22 of the PDF

An informative write-up on the changes can be found here:


http://awkwardhare.com/post/121196006730/quick-take-on-ios-9-url-scheme-changes