Search code examples
phpfacebooktabsfacebook-like

Like Gate on new timeline Brand pages


I have always had a like gate for brand pages for both a welcome page and for product pages, Q&A pages etc. The code I was using was as follows

<? require 'facebook.php';
$app_id = "[MY-APP-ID-HERE]";
$app_secret = "[MY-APP-SECRET-HERE]";
$facebook = new Facebook(array(
'appId' => $app_id,
'secret' => $app_secret,
'cookie' => true
));

$signed_request = $facebook->getSignedRequest();

$like_status = $signed_request["page"]["liked"];

if ($like_status) {

//You have liked the page

} else {
//You need to like the page
}

?>

Now with the new time line this like layer isn't working the way it used to. If you didn't like the page it came up with the like section then when you clicked like up the top it redirected to the like section of the if/else statement but now with time line it doesn't.

If you could help with a way to do this with the new time line layout for pages that would be so helpful.


Solution

  • You can subscribe to the assigned Facebook Bug :) Facebook Bug 228778937218386

    As an option/workaround, you could use the Hike Tab Builder with Fan Gating Plus+ to include the Like Button which uses FB.Event.subscribe('edge.create') to fade out the non fan content after like click: Facebook Hike Social App Page

    UPDATE: Bug is fixed by Facebook!