Check if the user is connected to facebook, and then check if he liked the page

Is there a way to check if a user is connected to facebook on my external page by not allowing them to allow one of my applications? And the same question concerns "check if the user liked the page."

I checked about 20 questions and 3-4 tutorials, and it seems that they all talk about internal scripts (tabs inside the fanpage / apps canvas pages), and my question is directed only to EXTERNAL pages.

If possible, write a sample code here (PHP + JavaScript). Thanks!

+2
javascript php facebook
source share
3 answers

How do I know when a user clicks the Like button?

If you use the XFBML version of the button, you can subscribe to the "edge.create" event through FB.Event.subscribe .

Check if users are logged in to facebook:

Check if the user is registered in the new Facebook API

0
source share

You can check if there is a facebook session using javascript sdk:

 <script type="text/javascript" src="http://connect.facebook.net/es_ES/all.js"></script> <script type="text/javascript"> FB.init({ appId : 'your app id', status : true, // check login status cookie : true, // enable cookies xfbml : true // parse XFBML }); FB.getLoginStatus(function(response) { console.log(response) // See other useful information on JavaScript console. console.log(response.status) // Show if the user is connected with facebook or not if (response.session) { // session found do something } else { // no user session available } }); </script> 

Hope this helps.

+2
source share

No, this is not possible from the external page. You can use javascript and subscribe to this event when they look like a page, but you wonโ€™t know the chapter of time if they already like your page. They will need to authenticate your application, and then you can execute the FQL query for validation.

0
source share

All Articles