Using PHP 5.2.11 and the new facebook graph code...
If I call
$facebook->api("/me");
I get a proper response:
array
'id' => string '10700210' (length=8)
'name' => string 'Brandon Renfrow' (length=19)
'first_name' => string 'Brandon' (length=7)
'middle_name' => string '✫' (length=3)
'last_name' => string 'Renfrow' (length=7)
'link' => string 'http://www.facebook.com/brenfrow' (length=32)
'about' => string 'Spiritual birthday: 1/22/2005' (length=29)
...
...
But if I call
$facebook->api("/me/picture");
I always get a response of:
null
Does anyone know why this is?
Open the Graph Explorer in a new browser window. This allows you to execute the examples as you read this tutorial. The explorer loads with a default query with the GET method, the lastest version of the Graph API, the /me node and the id and name fields in the Query String Field, and your Facebook App.
Applies to all versions. Facebook Analytics will no longer be available after June 30, 2021. Additionally, we are deprecating the App Dashboard Plugin for Marketing API. For more information visit the Business Help Center.
Well I guess the best answer I've found is to call http://graph.facebook.com/USER_ID?fields=picture to get the picture URL. Its to bad they don't document things like this on their API especially when its obvious this is broken for so many people.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With