Open the Facebook application from my application

Can someone tell URL schemes to open a Facebook application from my application?

+5
source share
1 answer

Use fb:// .

canOpenURL returns a BOOL value indicating whether the URL scheme can be processed by some application installed on the device. If canOpenURL returns YES , then the application is present on the device. If the user has installed Facebook on his device, we open it. If the user does not have Facebook installed, we open the page by the link that will launch Safari.

 // Check if FB app installed on device if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"fb://"]]) { [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"fb://profile/355356557838717"]]; } else { [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://www.facebook.com/DanielStormApps"]]; } 

Browse iPhone URL Schemas for a list of what else can be achieved through URL schemes.

In addition, starting with iOS 9, you should include LSApplicationQueriesSchemes in your info.plist .

enter image description here

+13
source

All Articles