I want to display a different message if a user is currently logged in to facebook and likes the current page. I understand:
FB.Event.subscribe(\'edge.create\'
Sense you describe the page as "current page" I understand that it is in an iframe tab. If this is the case, signed request supplies you with that information as $decode_signed_request = array('page' => array('liked' => true/false))
.
Otherwise you can supply a canvas page with the GET parameters fb_page_id
, which should include the parameter fb_sig_added to the server request with a 0/1 depending on if the user is a fan of that page. (This may require disabling OAuth 2.0 in your migration settings)
If you are talking about the like social plugin with an open graph url, you can not readily find out if the user is a fan without an application installation. If you do have that you can do an api call to /me/likes
which will return a list of all the likes that user has, and search for the id of the object you are testing for.