Vijikumar M
Vijikumar M

Reputation: 3764

How to get all the friends from facebook using hull?

I am using hull in my ruby on rails application to connect social media sites. From facebook I want to get all the friends details (like name, photo, and email). I used the following code which was given in the hull.io document. But it is not working. Can anyone suggest me how to get those details?

My code:

 Hull.api({provider:  'facebook',  path:  'me/friends'})
 .then(function  (friends)  {
  console.log(friends);
 },  function  ()  {
  console.log("The request has failed");
 }); 

The above code is returning only total sum of friends.

Upvotes: 0

Views: 222

Answers (1)

andyrandy
andyrandy

Reputation: 74014

  • You can only get friends who authorized your App too, for privacy reasons
  • You can´t get the email of any friend, only the email of the authorized user by using the "email" permission in the login process

In your case, there is no way to get all friends, but if you want to invite friends you can use invitable_friends and if you want to tag friends you can use taggable_friends. But remember, those are for inviting and tagging only, and you should read the articles in the Facebook docs for the rules for using them.

Upvotes: 1

Related Questions