Is it possible to retrieve the name of the app which will handle a specific URL?

In other apps I saw "Open Link in Safari" and if you click, YouTube or whatever else will launch. I don't really like this behavior and I'd like the get the corresponding app name before calling

[[UIApplication sharedApplication] openURL:[NSURL someURL]];

to set the right button title.

有帮助吗?

解决方案

No, that's not possible with the official SDK.

If you really want that you could create a file/database with the most common URL schemes on iOS (check this), then ship your app with it.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top