我正在使用Facebook SDK在墙上发布消息。
现在我需要获取Facebook好友列表。 有人可以帮帮我吗?
-- 编辑 --
try {
Facebook mFacebook = new Facebook(Constants.FB_APP_ID);
AsyncFacebookRunner mAsyncRunner = new AsyncFacebookRunner(mFacebook);
Bundle bundle = new Bundle();
bundle.putString("fields", "birthday");
mFacebook.request("me/friends", bundle);
} catch(Exception e){
Log.e(Constants.LOGTAG, " " + CLASSTAG + " Exception = "+e.getMessage());
}
我执行activity
时,没有看到任何东西,但在LogCat
中有一个调试消息:
06-04 17:43:13.863: DEBUG/Facebook-Util(409): GET URL: https://graph.facebook.com/me/friends?format=json&fields=birthday
当我尝试直接从浏览器访问此 URL 时,我收到以下错误响应:
{
error: {
type: "OAuthException"
message: "An active access token must be used to query information about the current user."
}
}