2011-10-01 9 views
0

사용자 로그인는 이벤트를 트리거 응용 프로그램

FB.Event.subscribe('auth.login', function(response) { 
      // 
     }); 

는하지만 난 그냥 사용자가 인증 대화 상자에서 응용 프로그램을 허용 할 때 트리거되는 이벤트를 찾고 있어요 때이 이벤트가 시작된다?

답변

0
FB.Event.subscribe('auth.authResponseChange', function(response) { 
    alert('The status of the session is: ' + response.status); 
}); 

auth.authResponseChange은 - 이론 있도록 authResponse 변경, 사용자가이 발사됩니다 인증 대화 상자에서 응용 프로그램을 허용 할 때 때졌습니다.

FB.getLoginStatus(function(response) { 
    if (response.authResponse) { 
    // logged in and connected user, someone you know 
    } else { 
    // no user session available, someone you dont know 
    FB.login(function(response) { 
    if (response.authResponse) { 
     console.log(reponse); 
     // here will be all the response details from confirmed app 
    } else { 
    console.log('User cancelled login or did not fully authorize.'); 
    } 
}, {scope: 'email'}); 
    } 
}); 
: 응용 프로그램을 허용하는 사용자에게 메시지를 표시하는 코드도 http://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/

에서

,

관련 문제