Facebook Graph API는 이메일 주소를 반환하지 않습니다.
편집 : 중복되지 않음 :
- 나는 허가를 받았다
- 토큰 디버깅
- 코드는 테스트 사용자와 함께 작동합니다.
읽지 않고 중복으로 표시하지 마십시오.
사용자 전자 메일 주소를 얻으려고하는데받지 못합니다. 그래프 API 탐색기에서 보내기를 누르면 이메일 필드가 회색으로 표시되고 다음과 같이 표시됩니다.
필드가 비어 있거나 액세스 토큰에 의해 허용되지 않습니다.
하지만 토큰을 디버깅하면 이메일 권한이 부여됩니다.
내 프로필에 이메일 주소가 있습니다.
업데이트 : https://developers.facebook.com/tools/console/ 시도했습니다 . 내 프로필은 다른 컴퓨터에서도 아무것도 반환하지 않습니다. 그러나 동일한 코드는 다른 계정의 이메일, 이름 및 uid를 반환합니다.
암호:
<fb:login-button scope="email">
Grant Permissions to make more examples work
</fb:login-button>
<button onclick="doPost()">Post to Stream</button>
<script>
function userData() {
FB.api('/me?fields=name,email', Log.info.bind('/me callback'));
};
FB.getLoginStatus(function(response) {
if (response.status === 'connected') {
userData();
}
});
</script>
아무도 가질 수 없도록 전자 메일을 잠글 수 있습니까? 권한을 부여해도?
마커스의 대답 은 내가 직면 한 진짜 문제로 나를 이끈다.
Facebook Explorer 도구로 디버깅 성공한 후 메서드 에서 이메일 범위 를 설정 해야한다는 것을 알 수있었습니다 FB.api()
.
FB.login(function(response) {
if (response.status === 'connected'){
FB.api('/me?fields=id,email,name', function(data) {
console.log( data.email ) // it will not be null ;)
})
}, {scope: 'email'});
빠른 시작 가이드 에서 명확하지 않으며 다른 사람에게도 도움이되기를 바랍니다.
나도 같은 문제가 있었는데 그 이유를 알아 냈다고 생각합니다 : 사용자가 Facebook에 확인되지 않은 이메일이있는 경우 (즉, Facebook에서 확인 메일을 이메일 주소로 보냈지 만 응답하지 않은 경우) Facebook은 해당 이메일을 앱에 전달하지 않습니다. 그가 당신에게 이메일 권한을 주더라도 (!!!).
그래서 제가 한 것은 그가 사용자 이름 (예 : userName@facebook.com)을 가지고 있다면 그의 Facebook 이메일을 사용하는 것입니다.
버그 보고서를 중복으로 표시하고 모든 게시물과 링크를 읽은 후이 문제의 원인과 해결 방법을 알았습니다.
문제 Facebook은 때때로 그래프 API에서 기본 이메일이 무엇인지 잊어 버리는 것 같습니다 (하지만 여전히 기본 설정에 있습니다.)
해결 방법 영향을받는 사용자는 전자 메일을 제거하고 설정을 저장 한 다음 주소를 다시 추가하고 다시 확인한 다음 기본 주소로 만들어야합니다. 이로 인해 샌드 박스 앱과 Facebook 로그인이 작동하지 않는 다른 앱에서 내 계정이 수정되었습니다.
새 페이스 북 그래프에는 다음과 같이 / me 요청에 추가 된 범위가 필요합니다.
/ me? fields = email, birthday, location, locale, age_range, currency, first_name, last_name, name_format, gender & access_token =
내 사이트의 fb 로그인 버튼을 개발하는 동안 동일한 문제가 발생했습니다. 여기에 내 앱에 대한 설정 권한도 있습니다.
https://developers.facebook.com/apps/<my-app-ID>/permissions
and it was working fine for certain initial cases, that is, it was giving email (i tested it on my own account and it was giving my email). Then suddenly it started to reflect no email at all. After two hours of browsing, I figured it out that there was an issue with the access token as when I went on this link:
https://developers.facebook.com/tools/explorer/<your-fb-id>/?method=GET&path=100002451127858%3Ffields%3Did%2Cemail
Update your-fb-id with your id and go to the above link. Click on 'Get Access Token'. In the tab that opens up, click on 'Extended Permissions' and in that, choose 'email' and submit. Now, test your query again. It'll definitely work, on the console as well as your website. Cheers! :)
This is a known bug. If the user does not have any email address set to primary, the query will return null for email. Set the email address for your account to primary https://www.facebook.com/settings?tab=account§ion=email&view and then try.
Source: https://developers.facebook.com/bugs/298946933534016/
ReferenceURL : https://stackoverflow.com/questions/16630972/facebook-graph-api-wont-return-email-address
'program story' 카테고리의 다른 글
svn 오류 413 요청 엔터티가 너무 큼의 원인은 무엇입니까? (0) | 2020.12.24 |
---|---|
자바 스크립트에서 C # (컨트롤러)로 datetime 전달 (0) | 2020.12.24 |
핸들 바의 항목을 반복 할 때 {{@index}}에 오프셋 추가 (0) | 2020.12.24 |
MySQL Alter 테이블로 인해 오류 : 잘못된 NULL 값 사용 (0) | 2020.12.24 |
RecyclerView에서 불일치가 감지되었습니다. 스크롤하는 동안 RecyclerView의 내용을 변경하는 방법 (0) | 2020.12.24 |