I am in the process of creating an Android App using Facebook Graph API where I need list of all friends of the user. How do I get list of friends using Facebook Graph API.
Apparently the API was available till Facebook Graph API v2.1, and was later removed. Is there any other way I can do it?
There is no way to get a list of all friends in the new api. Facebook has restricted this. Now it only shows list of friends who have already visited your app. So you can show like
"These are your friends who have used this app" but can't show a list of all friends. This is how you get friends list (who have visted app already)
$response = $fb->get('/me?fields=id,name,email,friends', $acces_token);
$user = $response->getGraphObject();
foreach($user['friends'] as $friend){
//Do Stuff here
}