Take the 2-minute tour ×

I have just implemented Facebook SDK 3.1.1 into my app with the intention of being able to share a picture, as well as 'Like' our product page from within the app. I can't seem to find a simple explanation or tutorial on how to code a button to automatically 'Like' a particular Facebook page. Can this only be done within a UIWebView? Can anyone point me in the right direction? Thanks.

share|improve this question
add comment

4 Answers

Unfortunately, no. The only way to like a Facebook page from within the iOS app, is to load up a UIWebView that navigates to the page, and then the user can like it.

share|improve this answer
add comment

Through Vishal's answer, I came to this link which can construct an iFrame 'Like' button which can be added in a UIWebView.

Construct Like Box

share|improve this answer
add comment

Now you can use the FBlike button using the following code but it need to download latest sdk and it is the beta version :(

Here is the code:

[FBSettings enableBetaFeature:FBBetaFeaturesLikeButton];
[FBSettings enablePlatformCompatibility:NO];
FBLikeControl *like = [[FBLikeControl alloc] init];
like.objectID = @"http://shareitexampleapp.parseapp.com/photo1/";
[self.view addSubview like];
share|improve this answer
add comment

Your Answer


