Ryan Dunlap
Ryan Dunlap

Reputation: 107

Is there a callback for THE Facebook fan page like button?

I have a facebook app in an iframed tab. If while on that tab a user likes the fan page via the Like button up there in the right corner, is there an event callback? Or anyway to subscribe to this event?

I know about the below code, but this doesn't seem to be working for the Like button on the fan page, I can only get it to work if I throw a Like button widget into the iframed tab, which is not what I'm looking for.

FB.Event.subscribe('edge.create', function(href) {
    // Do something, e.g. track the click on the "Like" button here
    alert('You just liked ' + href);
});

Upvotes: 0

Views: 1638

Answers (1)

Alexcode
Alexcode

Reputation: 1598

From the doc: When a user selects your Page Tab, you will receive the signed_request parameter with one additional parameter, page. This parameter contains a JSON object with an id (the page id of the current page), admin (if the user is a admin of the page), and liked (if the user has liked the page). As with a Canvas Page, you will not receive all the user information accessible to your app in the signed_request until the user authorizes your app.

https://developers.facebook.com/docs/appsonfacebook/pagetabs/

Upvotes: 2

Related Questions