发布隐私&QUOT后公开];使用Facebook的SDK [英] Publishing a post with privacy "Public" using Facebook SDK
问题描述
结果
我用这code张贴到墙上用户的图像
I am using this code to post an image to the user wall
Bundle params = new Bundle();
params.putString("method", "photos.upload");
params.putString(
"caption",
"Download link");
JSONObject privacy = new JSONObject();
try {
privacy.put("value", "EVERYONE");
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
params.putString("privacy", privacy.toString());
byte[] imgData = takeScreenshot();
params.putByteArray("picture", imgData);
mAsyncRunner.request(albumId, params, "POST",
new SampleUploadListener(), null);
我的问题是后隐私发布不作为公共,但我把它放在我的code,以人人 privacy.put(价值,每个人);
结果
是否有任何建议后为公共结果
谢谢
My problem is the post privacy is published not as "public" although I set it on my code to "everyone" privacy.put("value", "EVERYONE");
Is there any suggest to post it as "public"
Thanks
推荐答案
有关其他人寻找一个答案,我认为最简单的方法是只要求设置与权限时,默认可见性/观众:
For anyone else looking for an answer I think the easiest way is to just set the default visibility/audience when requesting the permission with:
LoginManager.getInstance.setDefaultAudience(DefaultAudience.EVERYONE);
或
fb_login_button.setDefaultAudience(DefaultAudience.EVERYONE);
有关第二个这是您的布局XML的外观:
For the second one this is how the XML in your layout looks:
<com.facebook.widget.LoginButton
android:id="@+id/fb_login_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
请参阅的https://developers.facebook.com/docs/reference/android/current/class/DefaultAudience/
这篇关于发布隐私&QUOT后公开];使用Facebook的SDK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!