Raptor
Raptor

Reputation: 54212

iOS FBSDKLikeControl / FBSDKLikeButton cached like result?

I found out that the FBSDKLikeControl cached the like result.

When I click the Like control to like a page, I can verify from browser that the page is liked. The FBSDKLikeControl codes are as follow:

if(likeButton) {
    [likeButton removeFromSuperview];
    likeButton = nil;
}
likeButton = [[FBSDKLikeControl alloc] initWithFrame:CGRectMake(150, 150, 200, 50)];
likeButton.likeControlStyle = FBSDKLikeControlStyleStandard;
likeButton.likeControlHorizontalAlignment = FBSDKLikeControlHorizontalAlignmentCenter;
likeButton.objectID = @"https://www.facebook.com/FacebookDevelopers"; // FBID: 19292868552
likeButton.center = self.view.center;
[self.view addSubview:likeButton];

Then, I unlike the Page in browser and reload the view controller to make sure the like button is recreated, the Like Control still claims I liked the page.

How can I avoid the cache? The same situation happens in FBSDKLikeButton. Using FBSDKShareKit 4.8.0 via Cocoapods

Upvotes: 1

Views: 490

Answers (0)

Related Questions