【问题标题】:Android Getting Facebook Mutual Friends How To Fill In USER ID?Android 获取 Facebook Mutual Friends 如何填写 USER ID?
【发布时间】:2014-09-02 17:12:27
【问题描述】:

我正在尝试将我的应用更新为从 facebook graph 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();

所以我编辑了这段代码以像这样输入用户 ID....

    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}

此别名确实存在。我的请求有什么问题?

【问题讨论】:

    标签: android facebook facebook-graph-api


    【解决方案1】:

    错误响应解释了它

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-12-25
      • 2013-04-25
      相关资源
      最近更新 更多