[英]Facebook api not returning Comments
我试图用facebook api获取一些数据。 这是我的代码
<?php
include 'src/facebook.php';
$facebook = new Facebook(array(
'appId' => 'xxx',
'secret' => 'xxx',
'cookie' => true
));
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
</head>
<body>
<?php
$user = $facebook->getUser();
if($user)
{
$user_profile = $facebook->api('/me/statuses');
echo "<pre>", print_r($user_profile), "</pre>";
echo "<a href=logout.php>Logout</a>";
}
else
{
$login_url_params = array(
'scope' => 'publish_stream,read_stream,offline_access,manage_pages'
);
$login_url = $facebook->getLoginUrl($login_url_params);
//redirect to the login URL on facebook
header("Location: {$login_url}");
}
?>
</body>
</html>
问题是当我print_r($user_profile)
它显示了所有应该包含在$user_profile = $facebook->api('/me/statuses');
但不会显示与状态相关的评论。 我在Graph API Explorer
中进行了尝试,它可以正常工作(显示所有数据),但是在我运行它的代码中; 它没有得到评论。
知道为什么会这样吗?
$user_profile = $facebook->api('/me/feed');
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.