Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- window.fbAsyncInit = function() {
- FB.init({
- appId : 'My App ID',
- cookie : true,
- xfbml : true
- });
- FB.getLoginStatus(function(response) {
- alert(response.status);
- if (response.status === 'connected') {
- var uid = response.authResponse.userID;
- var accessToken = response.authResponse.accessToken;
- alert(uid);
- }
- else{
- window.location.href="URL where i'm redirecting my app after logged out from facebook";
- }
- });
- };
- (function(d, s, id){
- var js, fjs = d.getElementsByTagName(s)[0];
- if (d.getElementById(id)) {return;}
- js = d.createElement(s); js.id = id;
- js.src = "https://connect.facebook.net/en_US/sdk.js";
- fjs.parentNode.insertBefore(js, fjs);
- }(document, 'script', 'facebook-jssdk'));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement