Click here to Skip to main content
15,883,868 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi2all i have tried to get my friends groups but faild my code (php)


PHP
$data['friends_groups']= $this->facebook->api('me/friends?fields=groups,name');

               //die(var_dump($data['friends_groups']));

               $this->dd($data['friends_groups']);




permissions

PHP
$params = array('scope' => 'user_status,publish_stream,user_photos,user_groups');
            $data['login_url'] = $this->facebook ->getLoginUrl($params);


when i dumped $data['groups']

it outputs the following
my friends
although i tested it in console and it returns correct answer

https://developers.facebook.com/tools/explorer?method=GET&path=me%2Ffriends%3Ffields%3Dgroups%2Cname&version=v2.0[^]
Posted
Updated 21-Jun-14 5:41am
v3
Comments
TheSniper105 21-Jun-14 12:23pm    
i have solved this my self the problem was that this only works in new facebook sdk 4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900