如何使用图形api获取用户的组和页面列表? [英] How to get the list of groups and pages of an user with graph api?
问题描述
我正在使用图形api,但我无法列出用户的页面和组。
I'm using graph api but I can't list the pages and groups of an user.
首先,对于权限,在范围内,我使用:
'cope'=>'publish_stream, user_groups ,user_about_me,user_interests,friends_groups,friends_interests,friends_about_me',
First, for the permissiones, in the scope, I use: 'scope' => 'publish_stream,user_groups,user_about_me,user_interests,friends_groups,friends_interests,friends_about_me',
然后,当我尝试下一个代码时,$ ct的值为0
and then, when I try the next code, the value of $ct is 0
<?php
session_start();
require 'config.php';
require 'facebook.php';
$facebook = new Facebook(array(
'appId' => $fb_app_id,
'secret' => $fb_secret,
'cookie' => true,
));
$user = $facebook->getUser();
$info = $facebook->api( '/me/groups', 'GET', array( 'access_token=' => $access_token ) );
$ct = count( $info['data'] );
echo $ct;
?>
推荐答案
这可能是一个愚蠢的问题,但你确定吗? :
This may be a silly question, but are you sure:
-
用户实际上在某些群组中(许多用户不是)
The user is actually in some groups (many users are not)
您肯定拥有user_groups权限(通过调用 / me / permissions
进行检查)
You definitely have the user_groups permission (check with a call to /me/permissions
)
这篇关于如何使用图形api获取用户的组和页面列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!