我/朋友空朋友列表

时间:2014-08-25 11:59:51

标签: android facebook

我正在尝试使用me / frineds标签获取好友列表。到目前为止,还没有该应用程序的用户,所以我添加了一些frirneds作为应用程序的测试人员。但他们没有在响应中显示我得到空数据列表。请指导我在这里做错了什么。这是代码

Bundle required = new Bundle();
                required.putString("fields", "id, name, picture.type(square), gender, email");

                //Request for friendlist from facebook
                Request req = new Request(session, "me/friends", required, HttpMethod.GET,
                        new Callback() {
                    @Override
                    public void onCompleted(Response response)
                    {
                         is2=response.getGraphObject();             
                         JSONObject json = is2.getInnerJSONObject(); 
                         readResponse(json);
                         String str = json.toString();
                         saveFileOnSD("data", str);
                        // generateNoteOnSD("frinedresponse", str);
                         Log.v(TAG, str);
                    }
                      });
                Request.executeBatchAsync(req);

2 个答案:

答案 0 :(得分:1)

使用v2.0,只有使用该应用程序的用户才会显示在好友列表中。仅在App Settings中添加某人作为Tester是不够的,用户必须授权您的App。

有关详细信息,请参阅changelog:https://developers.facebook.com/docs/apps/changelog

还有“invitable_friends”和“taggable_friends”,第一个仅用于游戏邀请,第二个仅用于标记。

答案 1 :(得分:0)

之前已经提出这个问题,下面列出的主题有很多细节。唯一的解决方法是你的应用是游戏。以下是其他帖子的链接:Facebook Graph Api v2.0+ - /me/friends returns empty, or only friends who also use my app

相关问题