을 friends_get. 이유를 추측 할 수 없었습니다. 내 접근 방식이 효과가없는 이유를 아는 것이 좋을 것입니다.문제는 아래의 조각이 내 응용 프로그램에 사용자의 페이스 북 프로필에서 친구 목록을 가져하도록되어 기능
1
A
답변
2
당신의 접근 방식은 효과가 있지만, 호출 한 Documented on the Facebook Developer Wiki, the function FB.ApiClient.Friends_get은 친구의 이름을 반환하지 않으므로 정수 (종종 정수보다 큽니다)의 숫자 값 배열을 반환합니다. 사용자의 이름을 반환하려면 추가 기능 FB.ApiClient.users_getInfo을 사용해야합니다. 또한 FB.Facebook.ApiClient를 호출 할 필요가 없으며 FB.ApiClient를 직접 사용하여 Facebook 객체를 우회 할 수 있습니다. 여기
은 예입니다 (테스트되지 않은,하지만 당신에게 아이디어를 줄 것이다) :<script type="text/javascript" src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php"></script>
<script type="text/javascript">
FB_RequireFeatures(
["XFBML"],
function() {
FB.Facebook.init("xxxxxxxx","xd_receiver.htm");
FB.Facebook.get_sessionState().waitUntilReady(
function() {
FB.ApiClient.friends_get(
null,
function(result,ex) {
FB.ApiClient.users_getInfo(result, 'name',
function(friendNames, exec) {
window.alert("first name in friends list: " + friendsNames[0]);
}
)
}
);
}
);
}
);
</script>
0
당신이 할 수있는 생각 : 나는 개발자 사이트에서 본
FB.ApiClient.friends_get(
new Array(),
.
이 방법이 효과가 있는지 궁금합니다. 어쩌면 응답을 게시하고, 투표를하는 것이 좋을지 ... – defines