Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook:Blank Screen on FB Login

suddenly I am getting a strange thing happening in my application when trying to login via facebook. The facebook connect popup dialog will show a blank screen after asking for login details. Normally I would expect to see the window close, and then the site itself would carry on, however it appears to have hung.

I am using Javascript SDK on Localhost

Here is the code I'm using (copying directly from the facebook documentation):

window.fbAsyncInit = function () {
    FB.init({ appId: fbAppId,
        status: false,
        cookie: true,
        xfbml: true
    });

};

(function (d) {
    var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
    if (d.getElementById(id)) { return; }
    js = d.createElement('script'); js.id = id; js.async = true;
    js.src = "//connect.facebook.net/en_US/all.js";
    ref.parentNode.insertBefore(js, ref);
} (document));



$(document).ready(function () {


    $("#fb_button_login").click(function () {


        FB.login(function (response) {
            if (response.authResponse) {
                console.log('Welcome!  Fetching your information.... ');
                FB.api('/me', function (response) {
                    console.log('Good to see you, ' + response.name + '.');
                });
            } else {
                console.log('User cancelled login or did not fully authorize.');
            }
        });


    });

});

Some other notes:

  • This appears to be happening on all browsers.
  • I have researched all other posts and can't seem to find a solution that works for me
  • There are no error messages showing up in console
  • When developing I use a separate FB app ID that I have setup specifically for localhost with the designated port I'm using (has worked fine for more than 12 months)
    • I do not have sandbox mode enabled

The URL it appears to hang on is here

Thanks guys.

like image 415
Tim Ricker Avatar asked Jul 02 '12 12:07

Tim Ricker


People also ask

Why is my Facebook blank when I log in?

It happens because you already logged in and authorized the app, so when it tries to log-in again, it goes blank. What most people do is to manually go into their Facebook account and remove their app so they can try again, but is this the best use of your time?

Why do I get a black screen on Facebook?

Check if you have images turned on in your Facebook data usage settings. Check if you have images enabled in your phone's mobile web browser settings. This is usually found on the main settings page or under the image quality menu.

Why my Facebook is not opening?

Try refreshing your browser or reopening the site; on a mobile app, close and reopen the app. You can also check to see if Facebook is offline and then restart your device, update apps, and clear your cache.


1 Answers

Seems like a bug: https://developers.facebook.com/bugs/241915819261223?browse=search_4ff2ead131a032989098325

From the comments in the above link, you can try running your app on port 80 and avoid the port part in the url

like image 95
aldrin Avatar answered Nov 06 '22 00:11

aldrin