简体   繁体   中英

Facebook Api getting total count of friends, but not friends data

Hi I am using Facebook API javascript SDK, and trying to get logged in user friends data Here is the scope i am using

    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 it returns me

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

data is always empty, though i am getting total count of my facebook friends

Since v2.0, you can only get friends who authorized your App too.

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

This question is also answered in several other threads already:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM