繁体   English   中英

android中的Facebook API集成..要获取我的好友列表“ me / friends”,我想获取名称和用户详细信息为

[英]Facebook API integration in android .. to get my friendlist “ me/friends ” i want to get all data with name and user details

   My code is 
             if (!facebook.isSessionValid()) {
                     facebook.authorize(this,
                    new String[]{"email","read_stream","read_custom_friendlists"},

                    new Facebook.DialogListener() {

                        public void onCancel() {
                            // Function to handle cancel event
                        }

                        public void onComplete(Bundle values) {
                            try {
                                getProfileInfo();



                            mAsyncRunner.request("me/friends ", new FriendsRequestListener());
                            /*  Bundle params = new Bundle();
                                params.putString("fields", "name, picture");
                                new FriendsRequestListener();*/


                            }
                            catch (Exception e)
                            {
                                System.out.println(e);
                                //Log.d("Error in fetching frnd list",String.valueOf(e));
                            }
                            //getProfileInfo();

                            // Function to handle complete event
                            // Edit Preferences and update facebook  acess_token


                        }

请签出我的代码,我也尝试了图形API资源管理器,但仍然在同一结果上不知道为什么..! 它返回{
“数据”:[],“摘要”:{
“总数”:446
}}

首先,您尝试使用的权限仅使您可以访问“朋友列表”,而不能访问“朋友”。 确保您了解差异:

read_custom_friendlists-是read_friendlists登录权限的新名称。 这是为了阐明该权限授予访问某个人的自定义朋友列表的权限,而不是该人的朋友的完整列表。

对于/me/friends您将需要user_friends权限,但是您也只会获得与user_friends一起授权您的应用程序的朋友。 有关更多信息,请参见无数Stackoverflow线程,例如: 使用Facebook Graph API获取所有用户朋友-Android

暂无
暂无

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

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