开发者

Facebook graph api gives empty result for likes

I'm trying my first very basic Facebook app using php and have stumbled upon a bit of a problem.

When being authenticated i can easily enough use the graph api to get information about my account...

$movies = $facebook->api('/me');
echo 'Me';
debug($movies);

which results in a nice array

Array
(
    [id] => 1000....
    [name] => ...
    [first_name] => ...
    [last_name] => ...
    [link开发者_运维问答] => http://www.facebook.com/profile.php?id=1000...
    [gender] => male
    [timezone] => 2
    [locale] => de_DE
    [verified] => 1
    [updated_time] => 2011-04-13T09:27:42+0000
)

I also can easily enough get a list of all my friends by using...

$friends = $facebook->api('/me/friends');
echo 'Friends:';
debug($friends);

But when I try to get my likes ...

$likes = $facebook->api('/me/likes');
echo 'Likes:';
debug($likes);

...all I get is an empty result:

Likes:

Array
(
    [data] => Array
        (
        )
)

When I use the demonstration link from the graph api page it displays my likes just fine, but not from inside my app.

Anybody has an idea why that might be? As far as I could find out there is no need for extra permission to get the likes of a logged in user, basic permissions should suffice?!


You Requires the user_likes or friends_likes permission to get the list of your / friends likes...

I think you forgot to get those permissions... :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜