My application requires a "Like Us on Facebook" functionality.I tried to use Facebook SDK and the "FBLikecontrol" of the SDK.This is the code i tried:
FBLikeControl *likeControl = [[FBLikeControl alloc] initWithFrame:CGRectMake(138, 270, 180, 40)];
[likeControl setObjectID:@"facebook page url"];
[likeControl setLikeControlStyle:FBLikeControlStyleStandard];
[[self view] addSubview:likeControl];
On running on the device(iOS7),when clicked on the like button,app redirects to the safari Facebook page and suddenly redirects backs to the app.Facebook page or nothing is showing.Can anyone help on this? Thanks in advance!
4.28.0 - November 7, 2017 Facebook SDK The Native Like Button has been deprecated. link
I tried your provided code in my Sample Application it working fine
My code is same as on facebook developer site Like Button iOS
Also don't forget to handle openURL method in Appdelegate
I am follow these steps and its working...
Step 1- Add Facebook button to your view
Step 2- Send for Review (Important Step) Native Like button will work if you submit it for review from Facebook app. Go to your Facebook app page --> Status and Review and send like button for review.
if you are not follow second step you will face redirect problem.