我正在使用这段代码:
$facebook->api('/me/likes/', 'post', array('url' => 'http://www.google.com'));
我收到以下错误:
Fatal error: Uncaught OAuthException: (#200) App does not have permission to make this call thrown in
范围(权限)是:
'scope' => 'publish_stream, email'
最佳答案
唯一可以通过编程方式点赞的是带有 likes
连接的 facebook 对象。
取自https://developers.facebook.com/docs/reference/api/ :
You can comment on or like any object that has a /comments or /likes connection by posting to https://graph.facebook.com/OBJECT_ID/comments and https://graph.facebook.com/OBJECT_ID/likes
更新:
user
对象也有一个 likes 连接,但它用于聚合其他对象的 likes,不可能“喜欢”一个用户。 (谢天谢地;P)
感谢@Juicy Scripter 指出这一点...
关于php - 我如何使用 Facebook SDK API 'Like' 页面/url?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8802910/