Saturday, 24 August 2013

Facebook button login issue (after succesful login)

Facebook button login issue (after succesful login)

I am trying FB login for a site for first time. I am able to see the FB
button and the popup window shows with what appears to be correct FB login
with my app name, so i think that part is good. my issue is after clicking
login I enter the user/pass, then window closes and nothing else happens.
I know I am logged in because when i click the FB again it pops up and
closes, so i guess it knows I am logged in to FB. but i cant see any of my
calls to write to console, and I am not sure how to make it do something
else after the loging... Maybe I am not understanding what happens after
the login to FB is succesful, am i missing something? . here is what I
have tried so far.
window.fbAsyncInit = function() {
FB.init({
appId : 'XXXXXXXX', // App ID
status : true, // check login status
cookie : true, // enable cookies to allow the server to
access the session
xfbml : true // parse XFBML
});
}
function doLogin() {
FB.login(function(response) {
if (response.authResponse) {
console.log('Hello! Getting account information.... ');
FB.api('/me', function(response) {
console.log('Hello, ' + response.name + '.');
});
} else {
console.log('User not fully authorize.');
}
});
}
// Load the SDK asynchronously
(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));
function testFbLogin() {
console.info("Testing you are Logged in...");
}

No comments:

Post a Comment