1

i am using facebook-sdk-master i used to create Facebook APP, i can't getting my friend list,i want to get my friends list but it always returning empty data.
my code :

    require '../src/facebook.php';
 echo curlUsingGet('https://graph.facebook.com/me/friends');
function curlUsingGet($url)
    {

   $facebook = new Facebook(array(
  'appId'  => 'app_id',
  'secret' => 'secret_id',
    ));

 $user = $facebook->getUser();
 $access_token =  $facebook->getAccessToken();

 $urlStringData =$url."?access_token=".$access_token ;
    $ch = curl_init();
    $headr = array();
$headr[] = 'GET /v1.0/me HTTP/1.1';
$headr[] = 'Host:graph.facebook.com';
    curl_setopt($ch, CURLOPT_HTTPHEADER,$headr);
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
     curl_setopt($ch, CURLOPT_CONNECTTIMEOUT,10);
     curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,FALSE);
     curl_setopt($ch, CURLOPT_URL, $urlStringData ); #set the url and get string together

     $return = curl_exec($ch);
     curl_close($ch);
     if($return  == false)
     {
         echo 'error:';
     }
     return $return;
     }
user4175452
  • 25
  • 1
  • 6
  • 2
    possible duplicate of [Facebook Graph Api v2.0 me/friends returns empty, or only friends who also use my app](http://stackoverflow.com/questions/23417356/facebook-graph-api-v2-0-me-friends-returns-empty-or-only-friends-who-also-use-m) – WizKid Oct 23 '14 at 20:37
  • 1
    ...and so many other threads too...also, since there is "/v1.0" in the code: you can only use v1.0 of the graph api with an app created before end of april 2014. new apps can only use the latest api version as minimum. – andyrandy Oct 23 '14 at 21:00
  • how to get each friend permission ? if you have sample code ,please provide me – user4175452 Oct 24 '14 at 03:06
  • It's only showing friends which also use the same app! And no, there's no workaround. Read the docs. – Tobi Oct 24 '14 at 06:21

0 Answers0