首页 文章

Android让Facebook共同朋友如何填写用户名?

提问于
浏览
1

我正在尝试将我的应用程序更新为从facebook图形API v2.0获取共同朋友的新方法 .

在他们的网站上:https://developers.facebook.com/docs/graph-api/reference/v2.0/user.context/mutual_friends

他们建议使用此代码:

Bundle params = new Bundle();
params.putString("fields", "context.fields(mutual_friends)");
 /* make the API call */
new Request(
session,
"/{user-id}",
params,
HttpMethod.GET,
new Request.Callback() {
    public void onCompleted(Response response) {
        /* handle the result */
    }
}
).executeAsync();

所以我编辑了这段代码,就像这样放入了用户名....

Bundle params = new Bundle();
                    params.putString("fields", "context.fields(mutual_friends)");
                    // make the API call
                    new Request(Session.getActiveSession(), "/{" + userProfile.getString("facebookId") + "}", params, HttpMethod.GET,
                            new Request.Callback() {
                                public void onCompleted(Response response) {
                                    /* handle the result */
                                    System.out.println(response.toString());
                                }
                            }).executeAsync();

当我运行代码时,我收到此错误:

{Response:responseCode:404,graphObject:null,error:{HttpStatus:404,errorCode:803,errorType:OAuthException,errorMessage:(#803)您请求的某些别名不存在:{10102533400666784}},isFromCache:false }

这个别名确实存在 . 我的要求有什么问题?

1 回答

  • 1

    错误响应解释了它

    {Response:responseCode:404,graphObject:null,error:{HttpStatus:404,errorCode:803,errorType:OAuthException,errorMessage:(#803)您请求的某些别名不存在:{10102533400666784}},isFromCache:false }

    此别名 {10102533400666784} 不存在删除 {}

相关问题