2012-05-05 22 views
0

Javascriptでログインした後にユーザーのFID、電子メール、および名前を取得したいので、Ajaxコールを作成してデータベースに保存します。Facebookでのログイン後にユーザーのFID、名前、Eメールを取得

これは、現在のユーザーにログインするためのコードです:

if (response.status === 'connected') { // the user is logged in and connected to your application 
     var uid = response.authResponse.userID; 
     var accessToken = response.authResponse.accessToken; 
     // Alert with fid, email and name 
     } else { //the user isn't logged in to Facebook or isn't connected to the application 
     FB.login(function(response) { 
      if (response.authResponse) { 
       accessToken = response.authResponse.accessToken; 
       // Alert with fid, email and name 
       } 
      }, {scope: 'email'}); 
     } 

は、私はそれをどのように行うことができますか?

+0

あなたはどこにいらっしゃいますか? – Dhiraj

答えて

2

コール

https://graph.facebook.com/me 

または

https://graph.facebook.com/USER_ID 

または

https://graph.facebook.com/fql?q=SELECT uid,name,email FROM user WHERE uid=me() 

あなたは

email 

PEが必要になりますレセプション

関連する問題