Facebook: Get when user clicks like button on fan page - facebook

I have created an app that will be used as a tab on my company facebook fan page. I have a new requirement to capture when the user clicks the like button on the facebook fan page and hide a portion of the app page (within the iframe) when the event fires. Although the like button is on facebook's page, is there a way to capture the click event of the like button (ie: javascript sdk) within my app iframe so I can hide appropriate elements?
Like this .... http://www.facebook.com/redbull
Thanks for any and all advice,
B

I found the answer...
How to detect Facebook Like button pressed and trigger event?
I checked the incoming request for fb_sig_is_fan.

I am afraid that this is not possible. Also it makes no sense! because Facebook will reload the page once you click on the like button!

Related

How to let a user in "internal Facebook App browser" to like my page without directing to a new page?

When I visit this page (Facebook Like Button official page) in my Facebook browser, the like button is working very gracefully.
It works this way:
1 - Click the "like"
2 - There will be a sparkle animation showing
3 - Then the like action is done
However, when I put the same code in a page of mine, still in Facebook internal browser, after clicking the like button, there's no animation and I am redirected to a new page, in which I'm asked to confirm the like action.
Here is the screenshot of the new confirm box
Is there a way to let the user like my page directly without this "Do you want to like this page" confirm box? I want this feature because people are taking actions on my page and if they are directed to another page, the status of that page is gone.
Thanks for any kind of tips!

how to check who and when clicked facebook like button

I using this to check how many likes are on my website
http://api.facebook.com/restserver.php?method=links.getStats&urls=http://mywebsite.pl
My Question is:
How to check who and when clicked facebook like button on my website?
There is no way to identify users who clicked a Like Button on your external Website, for privacy reasons. You can only see friends who liked the same URL by setting the "data-show-faces" flag in the Like Button Plugin.
You can subscribe to the edge.create event if you want to know when it gets clicked, but this still does not return WHO clicked it: https://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe

How to get notified when user clicks LIKE on your page (timeline layout)?

Up to now, the tab app automatically gets reloaded when user clicks "like". In new timeline fan pages it doesn't. How to catch that event?
Note that JavaScript SDK edge.create is working just for custom like buttons - not when users clicks default like button.
I think you can't, but don't worry, it's a bug that the page is not refreshing after being liked. Here's the bug reported:
https://developers.facebook.com/bugs/228778937218386?browse=search_4f500194bc1bd0293819428
However, I managed to do a workaround to detect if the page is still not using timeline by looking for an album called "Cover Photos" on the album list of that page. Here's a sample:
http://graph.facebook.com/-page_id-/albums?fields=name
You don't need a token unless the page isn't published yet.
The problem with this approach is that some pages still don't have cover picture yet, but it's the minority.

Facebook tab like button not working

I am developing a Facebook page for fans only. When a user lands on my page I am able to determine if it is a fan or not and display content appropriately. In the last few days I have noticed that non fans that land on my page and click on the native tab like button the page doesn't refresh to display the fan content.
What do I do about it? I haven't changed anything on my code to cause this. It just stopped working.
I didn't encounter such problems, but if you need a solution, try to subscribe to the edge.create event: https://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/
This way, you will be able to detect if someone clicks a like button and, if the like button for your page is clicked, you can redirect the users back on your tab, like a sort of refresh
Sounds like it might be a Facebook bug, nothing in your code should have any affect on the native like button.
Try submitting the bug at http://bugs.developers.facebook.net/

Facebook: any way to monitor when user clicks on Like button?

writing my first facebook webapp and i have some questions. I'm using their new Graph API + JS library.
The idea is that in order to use my webapp, user has to 'Like' facebook page A.
Suppose user is logged in. I have to check if he 'likes' page A. If user doesn't like that page, i display 'fan box' via
FB.XFBML.parse('<fb:fan profile_id="A's id" stream="0" connections="0" width="450"></fb:fan>');
Now, this fan box with 'Like' button is rendered in iframe that has src set to facebook domain.
Problem: i want to know when user clicks on 'Like' button so that i can display the rest of my webapp. The only possible solution that i can think of is polling every second facebook graph server which is really bad.
i can't attach 'onClick' event on that button cause it's inside iframe pointed to facebook domain (can't access it at all using JS)
i tried getting the contents of this iframe from my server and display it in iframe with empty src property so that i can access its elements - doesn't work, fan box is messed up.
There is no way that i know of to send 'i want to like that page' request to Graph server on behalf of the user.
I'm stumped. I really doubt that polling is the right way to solve this problem :)
You can get the onclick event by using the fbml code of like button instead of iframe code.
Facebook provides FB.event.subscribe which triggers when somebody clicks like button.
A complete tutorial is here.In your case you can write the code to refresh the page on like button click. and check for like condition on page load. so that if current user has liked the page you can redirect him to application page.