如何使用Android SDK中的Facebook SDK 4指定隐私设置(公共,朋友或只有我)墙壁邮件的隐私设置
问题描述:
是否有任何方法指定使用Facebook SDK 4的墙贴的隐私设置? SessionDefaultAudience类在以前版本的Facebook SDK中使用。但是怎么做最新的Facebook SDK?如何使用Android SDK中的Facebook SDK 4指定隐私设置(公共,朋友或只有我)墙壁邮件的隐私设置
答
最后我使用Facebook SDK 4隐私得到了墙后的解决方案:
JSONObject jsonObject = new JSONObject();
//use this line for all friends
jsonObject.put("value", "ALL_FRIENDS");
//or use this line for public
jsonObject.put("value", "EVERYONE");
//or use below 3 line for custom
jsonObject.put("value", "CUSTOM");
jsonObject.put("friends", "SOME_FRIENDS");
jsonObject.put("allow", theFriendsListIdForFamily);
Bundle postParams = new Bundle();
postParams.putString("privacy", jsonObject.toString());
https://developers.facebook.com/docs/reference/android/current/class/DefaultAudience/ – CBroe