my problem is when I try to get the pic_square and pic_big from the user connected to my application and I get an empty array. This is the code:
$facebook = new Facebook(array(
'appId' => FBAPPID,
'secret' => FBSECRETNUMBER,
'cookie' => true,));
$user_info = $facebook->api(array(
'method' => 'fql.query',
'query' => "SELECT pic_square, pic_big FROM user WHERE uid = me()",
'callback' => ''
));
During the login process I run the same code and it works, but later when I try to 开发者_C百科implement a function to synch the user picture with FB pic I get no error and no data. Any idea what is the problem?
Thanks a lot.
My guess is that later the facebook session doesn't exist so you don't have an access token to call the FQL query.
Anyway, why are you using FQL to get those pictures? You can always get them like this:
http://graph.facebook.com/me/picture?type=large or http://graph.facebook.com/me/picture?type=square
Or you can use the user id to get permanent links to the images:
http://graph.facebook.com/USER_ID_HERE/picture?type=square
Good luck
精彩评论