$me = $facebook->api('/me'); returns empty string

后端 未结 2 1250
小蘑菇
小蘑菇 2021-01-28 14:47

This piece of code used to work as expected, but now it seems i can\'t retrieve the user name the same way:

 $uid = $facebook->getUser(); // returns the faceb         


        
相关标签:
2条回答
  • 2021-01-28 15:29

    So how to retrieve the user name in facebook?

    What about this :

    $pageContent = file_get_contents('http://graph.facebook.com/USERID');
    $parsedJson  = json_decode($pageContent);
    echo $parsedJson->name;
    
    0 讨论(0)
  • 2021-01-28 15:42

    Facebook use CURL for send request to server, maybe curl on your server not work or curl_exec is disabled

    0 讨论(0)
提交回复
热议问题