I figured what happened!
Facebook's SDK generates a token for /me
. In PHP I was calling fb_user_id?fields=friends.fields(id,name,birthday,etc)
. But requests with /fb_user_id
can't return info with a /me
generated token.
It works when used directly on browser https://graph.facebook.com/me?fields=friends.fields(id,name,birthday,etc)
, but fails when called by Facebook's PHP class:
An active access token must be used to query information about the current user.
My solution:
$url = "https://graph.facebook.com/me?fields=id,name&access_token=$this->access_token";
$this->me = file_get_contents ( $url );
$json = json_decode($this->me, true);
For further information, checkout this answer. New ideas are welcome.