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.
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.
If you see OPEN instead of GET, Facebook is already installed on your iPhone.
BOOL isInstalled = [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"fb://"]] if (isInstalled) { } else { }
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 }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With