0


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);

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

JustMe
  • 6,065
  • 3
  • 19
  • 17

2 Answers2

0

I solved it flow these steps

Go to your list of apps (https://developers.facebook.com/apps?view=all_apps) Click on your app Click on 'App Details' Scroll down to 'App Center Listed Platforms' and click on the button on the right that says 'Configure App Center Permissions' Change the 'Default Activity Privacy' to public

JustMe
  • 6,065
  • 3
  • 19
  • 17
  • 1
    Has Facebook removed the 'Default Activity Privacy' section? I went to my app's 'Configure App Center Permissions' section, and 'Default Activity Privacy' is not there. – Doug S Aug 22 '15 at 04:39
0

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);

or

fb_login_button.setDefaultAudience(DefaultAudience.EVERYONE);

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" />

See https://developers.facebook.com/docs/reference/android/current/class/DefaultAudience/

Markymark
  • 2,804
  • 1
  • 32
  • 37