Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to detect if Facebook app is installed on iOS? [duplicate]

Tags:

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.

like image 846
Tom Kincaid Avatar asked Oct 30 '13 17:10

Tom Kincaid


People also ask

How can I check if an app is installed from a Web page on an iPhone?

Show activity on this post. iOS Safari has a feature that allows you to add a "smart" banner to your webpage that will link either to your app, if it is installed, or to the App Store. You do this by adding a meta tag to the page.

Does iPhone come with Facebook installed?

If you see OPEN instead of GET, Facebook is already installed on your iPhone.


2 Answers

BOOL isInstalled = [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"fb://"]]  if (isInstalled) {  } else {  } 
like image 127
Nikos M. Avatar answered Oct 08 '22 06:10

Nikos M.


Try just using the canOpenURL: function

NSURL *fbURL = [NSURL URLWithString:@"fb://"];//or whatever url you're checking  if ([[UIApplication sharedApplication] canOpenURL:fbURL]) {   //open it etc   } 
like image 28
Tommy Devoy Avatar answered Oct 08 '22 06:10

Tommy Devoy