페이스 북으로 로그인하려면 웹 사이트를 만들어야합니다. 그 (것)들에게 전자 우편을 보내기 위하여 이해 될 수있다, 그러나 나는 페이스 북에서 이메일 주소를 얻을 수 없다.Facebook API는 이메일 주소를 얻습니다
정확하게 지침을 따랐습니다. https://developers.facebook.com/docs/facebook-login/getting-started-web/ FB.login에 {scope : email}을 추가합니다.
Facebook API를 사용하여 이메일 주소를 얻으려면 어떻게해야합니까? 지금 쯤
내 코드
: 성공적으로 로그인 한 경우<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : 'app', // App ID
channelUrl : '//domain.COM/channel.php', // Channel File
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
FB.Event.subscribe('auth.authResponseChange', function(response) {
if (response.status === 'connected') {
FB.api('/me', function(response) {
console.log(response);
});
} else if (response.status === 'not_authorized') {
FB.login(function(response) {},{scope: 'email'});
} else {
FB.login(function(response) {}, {scope: 'email'});
}
});
};
// 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));
</script>
<fb:login-button show-faces="true" width="200" max-rows="1"></fb:login-button>
하는 데 도움이
희망을 (응용 프로그램에 권한이 부여 된 후 FB.login에 이메일을 ... 난 좋은 생각하지 않는 범위 추가) . 응답에서 나는 기초가있다. – Alqin
response.status가 연결된 경우 console.log (응답)의 출력은 무엇입니까? –