How to detect if Facebook app is installed on iOS?

Tom Kincaid picture Tom Kincaid · Oct 30, 2013 · Viewed 16.8k times · Source

On iOS, you can launch the Facebook app and link to a profile by opening a url like this: fb://profile/12345

The only problem is that if the Facebook app isn't installed, nothing happens.

Is there a way to detect if the app is installed or if the url scheme fb:// is supported?

This would apply broadly to other apps like Twitter as well.

Answer

Nikos M. picture Nikos M. · Oct 30, 2013
BOOL isInstalled = [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"fb://"]]

if (isInstalled) {

} else {

}