0

Facebookアカウントを使用して自分のウェブサイトにログインしようとしていますが、Facebookは名前とIDだけを与えてログインするだけでは不十分です。私は等のファーストネーム、姓、電子メールのような完全な情報を得ていた前に、今のFacebookが提供するFacebookのapi javascriptのみがユーザーの名前とIDを返す

データ:

stdClass Object 
(
    [name] => FName LName 
    [id] => 236189327864097 
) 

は、次のは、私は、ユーザーがログインするのOAuth V2.0を使用しています

FB.api('/me/feed?fields=gender', function(response) 
code:100 
fbtrace_id:"DolPwbvNcEH" 
message:"(#100) Unknown fields: gender." 
type:"OAuthException" 

を失敗しましたFacebookから私のウェブサイトへあなたが取得したいフィールドを指定する必要が

stdClass Object 
(
    [name] => FName LName 
    [id] => 236189327864097, 
    [gender] female 
) 

答えて

2
FB.api('/me', {fields: 'first_name,last_name,email'}, function(response) { 
    console.log(response); 
} 

次のように

は私が必要です。あなたは間違いなく、電子メールは別の許可が必要と投稿テーブルのフィールドではありません、しかし/me/feedエンドポイントで電子メールを取得することはありません:たとえばhttps://developers.facebook.com/docs/graph-api/reference/post

、これは何かを投稿したユーザーを取得する方法である:

FB.api('/me/feed', {fields: 'message,from'}, function(response) { 
    console.log(response); 
} 
関連する問題