2017-01-07 6 views
0

私はユーザーID、名前、電子メールを取得しようとしています。 私のコードはログインしてログアウトしています。私はログイン名を取得しますが、何かがありません。 なぜ私が変更されたときに作業response.name テストAPIを使用してresponse.eメールまたはresponse.idを動作しますが、私は電子メールとユーザーIDを必要としないplsはここfacebook loginユーザーがasp.netでユーザーデータを取得する方法

function testAPI() { 
     FB.api('/me', function (response) {  
      document.getElementById('status').innerHTML = response.name ; 
     }); 
    } 

を助ける私のログインボタンのコードです:

<fb:login-button scope="public_profile,email" onlogin="checkLoginState(); data-max-rows="1" data-size="medium" data-show-faces="true" data-auto-logout-link="true""> 
</fb:login-button> 

<div id="status"> 
</div> 

答えて

0

私は問題を解決しました。私はそれが誰かを助けることを願って ここに私の作業コードです:

function testAPI() { 
     FB.api('/me', 'GET', { "fields": "id,name,picture,email" }, function (response) { 
      document.getElementById('status').innerHTML = response.email ; 
     }); 
    } 
関連する問題