Facebook FB.getLoginStatus() Not Working

A lot of them complaining about `FB.getLoginStatus` method not responding. Lucky you, I'm one of them. This is just one of those things common to us when developing an application on Facebook platform. Perhaps the reason why sometimes, changes just seem so hard to adapt. At least only at first.

FB.getLoginStatus(function(response) {
  if (response.status === 'connected') {
    // the user is logged in and has authenticated your
    // app, and response.authResponse supplies
    // the user's ID, a valid access token, a signed
    // request, and the time the access token 
    // and signed request each expire

    var uid = response.authResponse.userID;
    var accessToken = response.authResponse.accessToken;

  } else if (response.status === 'not_authorized') {
    // the user is logged in to Facebook, 
    // but has not authenticated your app

  } else {
    // the user isn't logged in to Facebook.

My application is intended for Page Tab. I'm one of the administrators of it and it's being run on Sandbox Mode.

So here's what I did to solve this issue.

  • go to app's settings page, then Basic tab.
  • fill up `Site URL` field for `Website` under `Select how your app integrates with Facebook` section.
  • hit Save button then reload your app (canvas, page tab,...)

You should see FB.getLoginStatus() in action by now.

Related posts:


safiyullah mohamed said...

Thank you so much....
Last one week i spend to resole this issue.. Now i got the solution..

John Begley said...

OMG this was the 10th on the search results and finally the one which had the fix for my situation. (My app domain had www which I removed). Not exactly what this answer was about but you made me relaize the problem. Thank you!

Post a Comment

Hi there! Please leave your message here. Also, I may not be able to respond to your query right away. So please bear with me. Thanks. :)