Just use canOpenURL
of UIApplication class, like:
if([[UIApplication sharedApplication] canOpenURL:url])
{
[[UIApplication sharedApplication] openURL:url];
}
else
{
//show alert
}
canOpenURL:
Returns whether an application can open a given URL resource.
- (BOOL)canOpenURL:(NSURL *)url
Parameters
url
A URL object that identifies a given resource. The URL’s scheme—possibly a custom scheme—identifies which application can
handle the URL.
Return Value
NO if no application is available that will accept the URL; otherwise, returns YES. Discussion
This method guarantees that that if openURL: is called, another application will be launched to handle it. It does not guarantee that the full URL is valid. Availability
Available in iOS 3.0 and later.
Declared In UIApplication.h