PatrickGamboa
PatrickGamboa

Reputation: 672

How to launch Facebook with Button

Hey friends I created a button on my app called: "Find us on Facebook". Right now I ran into a situation where I need the button to launch the Facebook application. I could really use some help such as launching the facebook application, detecting if there is a facebook application, and all the sorts of stuff like that, thanks

Upvotes: 0

Views: 744

Answers (2)

MarkC
MarkC

Reputation: 185

there is a tutorial and sample app at https://github.com/facebook/facebook-ios-sdk

Basically you need to try to call fb://profile/yourpageid to load the FB app on your page. The sample app shows you how to do this and fall back to loading in Safari if the app is not installed on the device.

Upvotes: 1

Dave DeLong
Dave DeLong

Reputation: 243156

Some googling shows that the facebook app apparently registers to receive urls with the fb:// scheme. So you can construct a fb:// url (like, say fb://notes or something) and then ask the UIApplication object if it can open the URL. If it says that it can, then open it.

Upvotes: 1

Related Questions