简体   繁体   English

LoginButton要求朋友列表权限,为什么?

[英]LoginButton asking for friends list permission, why?

I am using the built in LoginButton widget in the facebook sdk, I haven't made any changes to it I just include it in my xml layout file and call setSessionStatusCallback nothing else. 我在facebook sdk中使用内置的LoginButton小部件,我没有对它进行任何更改我只是将它包含在我的xml布局文件中,并且没有其他任何调用setSessionStatusCallback

However, when I click the login button facebook says I am asking for both basic info AND the friends list. 但是,当我点击登录按钮时facebook说我要求基本信息和朋友列表。 I do not want permission to view the users friends, and after looking though the source of LoginButton it seems like it shouldn't be asking either, its permissions String list is empty. 我不希望权限查看用户的朋友,在查看了LoginButton的来源之后,它似乎也不应该问,它的permissions字符串列表是空的。

Whats going on here? 这里发生了什么?

update: adding my code by request. 更新:按请求添加我的代码。

    final LoginButton facebook = (LoginButton) getView().findViewById(R.id.facebook_login);
    if(facebook != null){
            if(Utility.getMetadataApplicationId(getActivity()) != null){
                facebook.setVisibility(View.VISIBLE);
                facebook.setSessionStatusCallback(new StatusCallback() {

                    @Override
                    public void call(Session session, SessionState state, Exception exception) {
                        if(session.isOpened()){
                            showProgress(true);
                            Request.executeMeRequestAsync(session, new GraphUserCallback() {

                                @Override
                                public void onCompleted(GraphUser user, Response response) {
                                    Log.d("test", user.getId());
                                }
                            });
                        }
                    }
                });
            }
    }

Asking for basic info + friends list is the most basic permissions that an app can request. 要求基本信息+朋友列表是应用可以请求的最基本权限。 If you do not supply any additional read permissions, then those two permissions are the only ones that will show up, and I do not believe you can remove them. 如果您不提供任何其他读取权限,那么这两个权限是唯一会显示的权限,我不相信您可以删除它们。

I believe we do this because when integrating your app with Facebook, the inherent reason is to make your app social and to provide a distribution channel for your app. 我相信我们这样做是因为在将您的应用与Facebook集成时,其固有的原因是让您的应用具有社交性,并为您的应用提供分销渠道。 So the friends list permission is added by default because you should use that permission to encourage the user to share your app with their friends if they wish to do so with the app requests dialog etc. 因此,默认情况下会添加好友列表权限,因为您应该使用该权限来鼓励用户与他们的朋友分享您的应用,如果他们希望使用应用请求对话框等。

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

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