2011-07-29 8 views
0

나는 Facebook 구현을 처음 사용합니다. 내가 익숙하지 않다 (질문은 정말 많이 설명하지 않습니다 OAuth2.0에Facebook OAuth2.0 구현

window.addEvent('domready', function(){  
FB.init("<%= ConfigurationManager.AppSettings["ApiKey"].ToString() %>", 
     "/xd_receiver.htm", 
     {"ifUserConnected": update_user_is_connected, 
      "ifUserNotConnected": update_user_is_not_connected, 
      "doNotUseCachedConnectState":"true"}); 
}); 

답변

1

을 사용하여 새 all.js 통해이 코드를 구현하는 데 도움이되지만 약간의 추측이 같은 뭔가해야 해주세요 기존의 API를, 그래서 당신이 update_user_is_connected/not_connected, 그에 따라 그것을 수정하는 인수를 전달할 수 있는지 여부를 모르는) :

http://developers.facebook.com/docs/reference/javascript/FB.getLoginStatus/

:

window.fbAsyncInit = function() { 
    FB.init({ 
     appId : '<%= ConfigurationManager.AppSettings["ApiKey"].ToString() %>', 
     status : true, // check login status 
     cookie : true, // enable cookies to allow the server to access the session 
     xfbml : true, // parse XFBML 
     channelUrl : 'http://www.yourdomain.com/channel.html', // Custom Channel URL 
     oauth : true //enables OAuth 2.0 
    }); 

    FB.getLoginStatus(function(response) { 
     if (response.authResponse) update_user_is_connected(); 
     else update_user_is_not_connected(); 
    }); 

    // This will be triggered as soon as the user logs into Facebook (through your site) 
    FB.Event.subscribe('auth.login', function(response) { 
     update_user_is_connected(); 
    }); 
}; 

당신은에서 자세한 내용을보실 수 있습니다

관련 문제