Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pressing FBLikeControl displays blank page and returns to app

I have integrated Facebook's native Like Button control in my iOS app with the following lines:

FBLikeControl *likeControl = [[FBLikeControl alloc] init];
likeControl.objectID = @"http://www.facebook.com/<mypage>";
// .. add likeControl to view hierarchy ..

The button appears fine and works some of the time. That is, when you press it it takes you to the Facebook app and prompts you to like the page in question. If you consent then it adds your like to the page.

But intermittently, it does not work. It takes you to the Facebook app, where it shows you a blank light gray / light white page with a small and light Facebook logo, pauses for a but and then sends you back to the app without taking any action.

Any ideas what might be making it fail?

like image 669
er0 Avatar asked Dec 06 '25 08:12

er0


2 Answers

FBLikebutton is a preview feature only developer and tester can use this functionality.

 FBLikeControl *likeControl = [[FBLikeControl alloc] init];
    likeControl.objectID = [NSString stringWithFormat:@"url here"];
    likeControl.likeControlStyle = FBLikeControlStyleButton;
    likeControl.frame = CGRectMake(0, 0, 44, 44);
    likeControl.transform = CGAffineTransformMakeScale(0.7f, 0.7f);
    likeControl.likeControlHorizontalAlignment = FBLikeControlHorizontalAlignmentCenter;
    likeControl.likeControlAuxiliaryPosition = FBLikeControlAuxiliaryPositionBottom;
    [likeControl sizeToFit];
    [self.view addSubview:likeControl];

check this code.
like image 147
hari krishnan Avatar answered Dec 07 '25 21:12

hari krishnan


It appears that you have to get the Native Like Button reviewed by Facebook before it becomes production-ready. The documentation for the Native Like button describes the penalty for non-reviewed apps as a "Beta" banner appearing on the Like page, and does not mention that it simply doesn't work, but this is the only explanation I could come up with. I have gone ahead and submitted my app for review. I'll update this post with the outcome.

-- Edit --

That was it. Our app was approved to use the Native Like Button within 48 hours of submission, and ever since, all Likes work fine. Prior to that, only likes by developers of the app were working. In short, to make the Native Like button work you have to submit it for review by Facebook. Go to your app page --> Status and Review.

like image 45
er0 Avatar answered Dec 07 '25 22:12

er0



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!