Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/186.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 已安装我的应用程序的Facebook好友_Android_Facebook Graph Api_Facebook Login - Fatal编程技术网

Android 已安装我的应用程序的Facebook好友

Android 已安装我的应用程序的Facebook好友,android,facebook-graph-api,facebook-login,Android,Facebook Graph Api,Facebook Login,我正在尝试检索已安装我的应用程序的朋友的ID列表。我当前正在使用此查询,但它返回0个朋友。。。为什么呢 GraphRequest request = GraphRequest.newGraphPathRequest( token, "/"+ facebookUserId +"/friends", response -> { User new

我正在尝试检索已安装我的应用程序的朋友的ID列表。我当前正在使用此查询,但它返回0个朋友。。。为什么呢

GraphRequest request = GraphRequest.newGraphPathRequest(
                        token,
                        "/"+ facebookUserId +"/friends", response -> {
                            User newUser = new User();

                            if (response.getError() != null) {
                                //TODO: Handle error gracefully
                                Log.e("TEST", response.getError().getErrorMessage());
                                return;
                            }

                            try {
                                JSONArray listOfFriendsJson = response.getJSONObject()
                                        .getJSONArray("data");
                                Log.i("TEST", "Found " + listOfFriendsJson.length() + " friends");

                                for (int i=0 ; i < listOfFriendsJson.length() ; i++) {
                                    JSONObject friendJson = listOfFriendsJson.getJSONObject(i);
                                    newUser.friends_list.put(friendJson.getString("id"), true);
                                    Log.i("TEST", friendJson.getString("id"));
                                }
                            } catch (JSONException e) {
                                Log.e(LOG_TAG, "Error parsing response of GraphRequest", e);
                                //TODO: Stop loading and show error
                            }

                        });
GraphRequest=GraphRequest.newGraphPathRequest(
代币
“/”+facebookUserId+“/friends”,回复->{
User newUser=新用户();
if(response.getError()!=null){
//TODO:优雅地处理错误
Log.e(“TEST”,response.getError().getErrorMessage());
返回;
}
试一试{
JSONArray ListofFriendJSON=response.getJSONObject()
.getJSONArray(“数据”);
Log.i(“TEST”、“Found”+listofriendsjson.length()+“friends”);
for(int i=0;i

…请求以下权限的应用现在受到 在登录审查期间加强审查:

  • 用户与朋友
我假设您的朋友的登录对话框中没有显示用户\u friends权限。尝试将您的好友添加为应用程序设置中的测试员,然后再次完成登录过程。确保您在两部手机上都被要求获得
用户朋友
权限。

…请求以下权限的应用现在受到 在登录审查期间加强审查:

  • 用户与朋友

我假设您的朋友的登录对话框中没有显示用户\u friends权限。尝试将您的好友添加为应用程序设置中的测试员,然后再次完成登录过程。确保您在两部手机上都被要求获得
user\u friends
权限。

您是否100%确定您的一些朋友使用user\u friends权限授权了您的应用程序?我尝试从一个朋友的手机登录(按下我应用程序中的登录按钮),他是我在Facebook上的朋友。但是它在我们的手机上都显示了0个朋友,并且用户的好友权限确实显示了,而且你肯定授权了它?你100%确定你的一些朋友使用用户的好友权限授权了你的应用程序吗?我尝试从一个朋友的手机登录(按下我应用程序中的登录按钮),他是我在Facebook上的朋友。但是它在我们的手机上都显示了0个朋友,而且用户朋友权限确实显示了,你肯定授权了吗?实际上我刚刚意识到用户朋友没有显示在我的权限上,我想这就是问题所在。。。谢谢事实上我刚刚意识到用户朋友没有在我的权限上出现,我想这就是问题所在。。。非常感谢。