FB 웹 사이트에 FB 로그인을 통합하고 있으며 사용자의 이메일이 필요합니다. 여기에 코드의 일부가 나와있다.PHP - 그래프 API 2.8이 이메일을 요청하지 않습니다.
$fb = new Facebook\Facebook([
'app_id' => 'app-id',
'app_secret' => 'secret',
'default_graph_version' => 'v2.8',
]);
$helper = $fb->getJavaScriptHelper();
try {
$accessToken = $helper->getAccessToken();
} catch(Facebook\Exceptions\FacebookResponseException $e) {
// When Graph returns an error
echo 'Graph returned an error: ' . $e->getMessage();
} catch(Facebook\Exceptions\FacebookSDKException $e) {
// When validation fails or other local issues
echo 'Facebook SDK returned an error: ' . $e->getMessage();
}
if (isset($accessToken)) {
$fb->setDefaultAccessToken($accessToken);
try {
$requestProfile = $fb->get("/me?fields=name,email");
$profile = $requestProfile->getGraphNode()->asArray();
} catch(Facebook\Exceptions\FacebookResponseException $e) {
// When Graph returns an error
echo 'Graph returned an error: ' . $e->getMessage();
} catch(Facebook\Exceptions\FacebookSDKException $e) {
// When validation fails or other local issues
echo 'Facebook SDK returned an error: ' . $e->getMessage();
}
print_r($profile);
}
내가 돌아 오는 것은 이름과 ID이다. 사용자에게 앱 사용 권한을 요청하는 팝업조차도 이메일을 요구하지 않습니다. 그리고 당연히 그것을 돌려주지는 않습니다.
나는 this과 많은 다른 질문을 보았지만 어느 솔루션도 저에게 효과적이지 않았습니다. 내가 도대체 뭘 잘못하고있는 겁니까?
_ "사용자에게 앱 사용 권한을 부여하지 않아도 _을 (를) 요청하지 않았습니다."_는 로그인을 트리거하는 코드 부분에서 권한을 요청하지 않았 음을 의미합니다. – CBroe
아 ... 뭔가있을 수 있습니다. 내가 자바 스크립트를 조사하자. – VeeK