我糊涂了。我编写了一个PHP程序,将我的应用程序与Facebook连接起来。如果用户授予权限,我将facebook UID存储到数据库中。
现在,在用户返回到我的应用程序并登录之后,我可以从数据库中检索他的facebook UID。
问题:如何使用PHP来获取好友请求的数量,收件箱中的消息等?如果我这样写:
require 'facebook/facebook.php';
$facebook = new Facebook($this->FACEBOOK_PARAMS);
$fql = "SELECT notification_id, sender_id, title_html, body_html, href FROM notification WHERE recipient_id=" . Zend_Auth::getInstance()->getIdentity()->fb_uid .
" AND is_unread = 1 AND is_hidden = 0";
$param = array(
'method' => 'fql.query',
'query' => $fql,
'callback' => ''
);
$fqlResult = $facebook->api($param);
$fqlResult = $fqlResult[0]; // list of permissions
我得到错误消息:"需要用户会话"。
再见,由于
您需要图形API: http://developers.facebook.com/docs/reference/api/并且您需要使用http://developers.facebook.com/docs/authentication/