Skip to content

Instantly share code, notes, and snippets.

@dhigginbotham
Created January 30, 2013 17:56
Show Gist options
  • Save dhigginbotham/4675163 to your computer and use it in GitHub Desktop.
Save dhigginbotham/4675163 to your computer and use it in GitHub Desktop.
var _s
, FacebookConnect = {
settings: {
status: null,
login: $('#facebook-auth')
},
init: function() {
_s = this.settings;
this.bindUI();
},
bindUI: function() {
_s.login.live('click', function() {
FacebookConnect.getLoginStatus();
});
},
getLoginStatus: function() {
FB.getLoginStatus(function(response) {
if (response.status === 'connected') {
// the user is logged in and has authenticated
console.log('User is connected');
} else if (response.status === 'not_authorized') {
console.log('User is not connected');
// the user is logged in to Facebook,
// but has not authenticated your app
} else {
console.log('User is not logged into Facebook');
// the user isn't logged in to Facebook.
}
});
}
};
//fireworks!
(function() {
FacebookConnect.init();
// console.log(FB.getAccessToken());
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment