get Facebook friends first_name without second api call

In my Ionic project, I'm running this fb javascript api call:

$cordovaFacebook.api("me/friends", ["user_friends"])
                .then(
                    function(success) {
                      console.log("SPLASHCTRL: FB: GOT FBAPP FRIENDS SUCCESFULLY: " + success.data.length);

                       $scope.fbAppFriends = success.data;
                       console.log('SPLASHCTRL: FB: SETTING LOADING TO FALSE');

                       $scope.loadingFbFriends = false;
                    // success
                   }, 
                   function (error) {
                    console.log('SPLASHCTRL: FB: ERROR GETTING FRIENDS' + JSON.stringify(error));

                  }
                );

which works, but only returns friend's name, id... , not containing his first_name.

Would there be a way to require this directly in the data response, or am i supposed to use the api for every friend again?

Answers


Easy solution in one call:

me/friends?fields=first_name,last_name

Need Your Help

Foreign key cross-databases error in laravel 4

database laravel-4 foreign-keys eloquent

I made migration with foreign key 'user_id' to a table 'users' that is in another database:

How can I pass @<text> for an extension method?

c# asp.net-mvc model-view-controller

How can I pass @&lt;text&gt;&lt;/text&gt; for an extension method?

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.