【发布时间】:2011-06-04 10:42:01
【问题描述】:
我正在使用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."
}
}
【问题讨论】:
-
stackoverflow.com/a/34354121/3064935请参考此帖获取facebook好友列表。