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:
The URL it appears to hang on is here
Thanks guys.
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?
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With