Facebook Api Gets Total Friends But Not Friends

Hi, I am using javascript javascript API and trying to enter user friends data Here is the area I use

FB.login(function(response) { statusChangeCallback(response); }, { scope:'publish_actions,user_friends,public_profile', return_scopes: true }); FB.api('/me', function(response) { $textInput = document.getElementById("searchText"); var request = jQuery.ajax({ type: "POST", url: "/logged/ajax/facebook", data: response }); request.done(function( $data ) { jQuery(".loadingContent").css( "display", "none" ); if($data == "success"){ FB.api('/me/friends', function(data) { console.log(data); }); } else { alert($data); } }); request.fail(function( jqXHR, textStatus ) { }); }); 

but he brings me back

 ({"data":[],"summary":{"total_count":79}}) 

the data is always empty even though I get the total number of my facebook friends

+5
source share
1 answer

Since v2.0, you can only get friends who have also approved your application.

Check out the change log for more information: https://developers.facebook.com/docs/apps/changelog

This question also answers already in several other threads:

+7
source

Source: https://habr.com/ru/post/1211484/


All Articles