重複の可能性:
Facebook の友達のメールを取得するには?
私のアプリケーションでは、ユーザーの友達のメール アドレスを取得する必要があります。次のコードを試しましたが、友達のメール アドレスを取得できませんでした。
私のコード:
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : 'xxxxxxxxxxxxxxx',
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true, // parse XFBML
oauth :true
});
function login(){
/* Show User's Name*/
FB.api('/me/friends', function(response) {
alert("user name:"+response.name);
alert("user mailid:"+response.email);
// document.getElementById('login').style.display = "block";
// document.getElementById('login').innerHTML = response.name + " succsessfully logged in!";
});
//window.location="http://google.com"; // Redirect to Another Page.
}
しかし、アラートにはメールIDが表示されていません。これをグーグルで調べたところ、メールは公共の財産ではないことがわかりました。そのため、メールIDを取得するために何ができますか。