douming4359 2011-04-13 12:05
浏览 30
已采纳

Facebook图形api给喜欢的空结果

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?!

  • 写回答

1条回答 默认 最新

  • dronthpi05943 2011-04-13 12:17
    关注

    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... :)

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥30 STM32 INMP441无法读取数据
  • ¥100 求汇川机器人IRCB300控制器和示教器同版本升级固件文件升级包
  • ¥15 用visualstudio2022创建vue项目后无法启动
  • ¥15 x趋于0时tanx-sinx极限可以拆开算吗
  • ¥500 把面具戴到人脸上,请大家贡献智慧
  • ¥15 任意一个散点图自己下载其js脚本文件并做成独立的案例页面,不要作在线的,要离线状态。
  • ¥15 各位 帮我看看如何写代码,打出来的图形要和如下图呈现的一样,急
  • ¥30 c#打开word开启修订并实时显示批注
  • ¥15 如何解决ldsc的这条报错/index error
  • ¥15 VS2022+WDK驱动开发环境