Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FB.getLoginStatus doesn't work?

The FB.getLoginStatus function doesn't work for me for some reason - although it used to for some time. Very basic code below, and the alert never popups - looks like FB.getLoginStatus never calls the supplied function. Any ideas ?

<body>
<form id="form1" runat="server">
<div id="fb-root">
</div>
<script type="text/javascript" src="http://connect.facebook.net/en_US/all.js"></script>
<script type="text/javascript">
    FB.init({ appId: 'xxx', status: true, cookie: true, xfbml: true });
    FB.getLoginStatus(function (response) {
        alert("Hi there");
    });
</script>
</form>

like image 675
Evgeni Avatar asked Jan 31 '11 01:01

Evgeni


1 Answers

If your app is in Sandbox Mode see this bug: https://developers.facebook.com/bugs/240058389381072

Also read the comments by Philip Bulley

[...] Essentially sandboxed applications are invisible to non-app-developers. If there is no user currently logged into Facebook, Facebook will act as if your sandboxed application doesn't exist at all (FB obviously doesn't know you're an app developer, and thus the app is invisible!).

This bug has been confirmed and assigned.

like image 111
Chris Jacob Avatar answered Oct 18 '22 10:10

Chris Jacob