简体   繁体   English

Facebook好友列表返回空白

[英]Facebook friends list returns empty

In my application I'm trying to retrieve the user's friends list. 在我的应用程序中,我试图检索用户的朋友列表。 I ask for user_friends permission and check in the activity the the permission is granted. 我请求user_friends许可,并在授予许可的活动中检查。 The problem is that the friends list returns empty at any time. 问题是朋友列表随时都返回空。

I use the following code: 我使用以下代码:

        Request request = Request.newMyFriendsRequest(_session, new Request.GraphUserListCallback() {

        @Override
        public void onCompleted(List<GraphUser> listFacebookFriends, Response response) {
            Toast.makeText(MainActivity.this, ""+listFacebookFriends.size(), Toast.LENGTH_LONG).show();
            Log.d(TAG, response.toString());
        }
    });

    request.executeAsync();

And the returned response is: 返回的响应是:

{Response:  responseCode: 200, graphObject: GraphObject{graphObjectClass=GraphObject, state={"data":[]}}, error: null, isFromCache:false}

What can be the problem? 可能是什么问题?

I assume you created your app after 4/30/2014 which means that you are using v2.0 of the API. 我假设您是在2014年4月30日之后创建的应用,这意味着您正在使用API​​的v2.0。 That means that only friends that are using the app will get returned. 这意味着只有正在使用该应用程序的朋友才能得到回报。

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

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