0

I am new to developing android apps with facebook functions. Currently my app has the functions for log-in and friend list fetching.

What I want to do is for my app to have its own friendlist (sort of social network) so when the user first logs in, he has no friends, but then he can add them from the list of friends from facebook. However, what I don't want is for the user to send more than one friend request to a single person.

Actually I store the invitations he sends and the friends he already has but when I fetch the Facebook friend list via Graph API it gives me ALL the friends that are using the app and I have to filter it to remove all the current friends and the friends he already send invitations to.

I was wondering if there is some way to create a private facebook list with the friends the user has send invitations to, and then when I fetch the normal friendlist (/me/friends) to automatically remove the ones that are registered in the private friendlist. Or if there is another way to do this and avoid in-app list filering

JMorales
  • 115
  • 1
  • 9
  • Which version of api are you using. As per my knowledge the graph api will return only those friends who are using the same app. So how are you getting all the other friends?? – Msk May 11 '15 at 20:23
  • Graph 2.3 and yes I am only working with the friends using the same app – JMorales May 11 '15 at 23:12
  • 1
    There aren't a lot of options for limiting results in Graph API... In FQL there was, but FQL was deprecated as of v2.1 – QuotidianVoid May 11 '15 at 23:23

1 Answers1

0

For that case, there is no way to get all friends anymore. You can only get those who authorized your app too with /me/friends.

Everything else is explained in the answer of this thread: Facebook Graph Api v2.0+ - /me/friends returns empty, or only friends who also use my app

If you understand that, then i am not sure what your question is, to be honest. If you want to create your own friendlist, you can just do that, but there is no Facebook API for this.

Community
  • 1
  • 1
andyrandy
  • 72,880
  • 8
  • 113
  • 130
  • Thanks, I know I can't get all the friends. I am only working with the friends using the same app but I want the user to select wich of those friends he wants to add to my app – JMorales May 11 '15 at 23:13
  • then the last paragraph of my answer applies – andyrandy May 11 '15 at 23:28
  • Ok, but what would be the best way to filter the /me/friends list to remove the users from my own friendlist? – JMorales May 11 '15 at 23:31
  • you just go through /me/friends and compare it with your own friendlist. it´s as simple as creating a loop in your language of choice. – andyrandy May 12 '15 at 06:35
  • Thank you, i was trying to avoid the loop to be performed on the device but I can't see another way. – JMorales May 12 '15 at 15:47