Benjohn Barnes
Benjohn Barnes

Reputation: 121

Querying the Installed URL Handlers on iPhone

Is there some why my application can query the URL handlers that have been installed / are supported?

The use case here is that I'd like my app to allow users to send tweets using either its built in tweeting, or by using their preferred twitter client. I'd like to let them select the client from a list of those that they have on the phone (or show a list with those they have installed highlighted, or something). Another app I plan to write would also benefit from being able to check for available handlers to then provide integration possibilities to its user.

Thanks, Benjohn

Upvotes: 2

Views: 365

Answers (1)

notnoop
notnoop

Reputation: 59299

You can only find if there is a handler for a given URL via UIApplication.canOpenURL::

NSURL *url = [NSURL urlWithString:@"http://example.com"];
BOOL tweet = [[UIApplication sharedApplication] canOpenURL:url];

Unfortunately, you cannot query for all the handlers or know which application handles which urls.

Upvotes: 4

Related Questions