简体   繁体   English

Facebook SDK 3.0 for Android - “我的朋友”请求永远不会返回

[英]Facebook SDK 3.0 for Android - “my friends” request never returns

I've started making the upgrade to Facebook SDK 3.0 for Android. 我已经开始升级到Facebook SDK 3.0 for Android。 I've managed to open an active session (using the Session.openActiveSession(...) method) and get the current user's info (using the Request.executeMeRequestAsync(...) method). 我设法打开一个活动会话(使用Session.openActiveSession(...)方法)并获取当前用户的信息(使用Request.executeMeRequestAsync(...)方法)。 However! 然而! When I try to get the current user's list of friends as follows... 当我尝试获取当前用户的朋友列表时如下...

Request.newMyFriendsRequest(
    Session.getActiveSession(),
    new Request.GraphUserListCallback()
    {
      @Override
      public void onCompleted(List<GraphUser> users, Response response)
      {
        // never called
      }
    });

... the onCompleted(...) callback is never called and my user is left hanging, forever. ... onCompleted(...)回调永远不会被调用,我的用户永远都会被挂起。 I've checked and my access token is valid and I'm pretty sure no extra permissions are needed to get the current user's list of friends. 我已经检查过,我的访问令牌是有效的,我很确定不需要额外的权限来获取当前用户的朋友列表。 Any ideas anybody? 任何人的想法? I'm stuck and Facebook developers bug-reporting is disabled! 我被困了,Facebook开发人员错误报告被禁用了!

Calling Request.newMyFriendsRequest just creates the request, it doesn't execute it. 调用Request.newMyFriendsRequest只是创建请求,它不执行它。

You need to do something like: 你需要做一些事情:

Request request = Request.newMyFriendsRequest(...);
request.executeAsync();

or just 要不就

Request.newMyFriendsRequest(...).executeAsync();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM