facebook图表Api,如何设置隐私设置

tee*_*kib 2 android facebook-graph-api

我有一个自定义dailog与一个微调器,以选择谁可以在用户墙上看到我们的帖子,我想选择并张贴在我的墙上,但不知道如何将隐私设置放在墙上并发送它.

getId = getfbId(id);

        if (getId != null) {

            String url = Constants.fbindexURL + "lang=" + lang + "&lat=" + lat + "&getfbid=" + getId;
            myplace = Constants.loadedplace.getCityName();
            parameters.putString("name", getString(R.string.reply));
            parameters.putString("caption", fbUuer + " in " + Constants.loadedplace.getCityName());
            parameters.putString("link", url);
            parameters.putString("picture", Constants.ImageURL);    
//------------> parameters.putString("privacy",  );
Run Code Online (Sandbox Code Playgroud)

下面是获取我的微调器的值的代码

 spinner = (Spinner)dialog.findViewById(R.id.spinner);
             spinner.setOnItemSelectedListener(new Adapter

View.OnItemSelectedListener() {
                    public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) {
                        String choose = spinner.getSelectedItem().toString();

                    }
                    public void onNothingSelected(AdapterView<?> parent) {
                    }
                });
Run Code Online (Sandbox Code Playgroud)

可以有人提出我怎样才能选择从旋转器中看到谁并在我的墙上相应地张贴.任何帮助表示赞赏

Sid*_*ele 7

两个Facebook文档在这里很重要:

  1. https://developers.facebook.com/docs/reference/api/user/(向下滚动到页面末尾以查看POSTS - 创建部分.)
  2. https://developers.facebook.com/docs/reference/api/privacy-parameter/

这里重要的一点是,您只能为自己墙上的帖子选择不同的隐私设置.更重要的是用户必须主动选择自己的隐私.第一次选择应用权限时,您无法覆盖用户选择的默认设置.(他们的帐户设置中可用的)

要更改单个帖子的隐私,例如,如果您只需要发布帖子,则需要在参数中包含此信息:

注意:隐私设置必须位于JSON对象中.

privacy={'value':'SELF'}
Run Code Online (Sandbox Code Playgroud)

用法示例:

JSONObject jsonObject = new JSONObject();
jsonObject.put("value", "SELF");
parameters.putString("privacy", jsonObject.toString());
Run Code Online (Sandbox Code Playgroud)

上面提到的第二个链接有更多细节可供使用.请阅读所有内容以更好地配置您的应用.

建议:要在FB上选择您希望允许帖子显示的朋友,您可以在此处使用此示例从以下位置选择多个用户GridView:http://vikaskanani.wordpress.com/2011/07/20/android-custom -图像画廊与-复选框功能于电网到选择-多个/