Sunday, 8 September 2013

Dertermine if user is logged in to Facebook w/o using Facebook api

Dertermine if user is logged in to Facebook w/o using Facebook api

I'm serving a list of events to my clients' website. They include it via
php/curl (rather than iFrame), so they can fully customize the CSS.
However, this means that I can't use the Facebook API to find out wether a
visitor of my client's page is logged in to FB: The FB-API call needs to
be signed by an application and shall only be called from the domain the
application is associated with. (That would be my server's domain, but the
requests are coming from my client's page.)
Back in the old days, accessing a user profile on FB would issue a 404
error, if not logged in.
<script type="text/javascript" src="https://www.facebook.com/pianojoe"
onload="enable_social_links()" onerror="not_logged_in_to_facebook()"
async="async"></script>
That was convenient, but FB took care :-/ of it.
I want to show FB-links for the events in my calendar only if the page
visitor is logged in to Facebook.
My question: How do I find out if a page visitor is logged in to Facebook
if I can't determine the domain of the referring page beforehand, and
therefore not use the Facebook API?

No comments:

Post a Comment