Can I programmatically determine which application will open the given URL?

I'm trying to figure out which iOS application will open the given URL.

I know that the URLs “http: // ...” will open in Safari and that, for example, the URLs “twitter: // ...” will open in a Twitter application, but is there any way to get this information programmatically?

I am looking for a method that I can call with a URL (or just a scheme / protocol) to find out the package identifier (or even just the localized name) of the application that will be called when -openURL is called.

Is there something like the following?

 [UIApplication handlerForURL:someUrl]; // @"com.dev.app" 
+4
source share
1 answer

On Mac, there is an API function called LSGetApplicationForURL in the framework launcher that does this for you.

Although iOS has the same API function, Launch Services is a private API .

No, you cannot do this on iOS.

There is a logical method on UIApplication that will determine if a URL can be opened , but this is not the same as knowing how it will open.

+2
source

All Articles