Sending photo with public privacy

2

Through the code below, I can send a photo to the user's photos that is logged in, and the photo is sent successfully.

But the photo goes Friends .

How do I submit with Public privacy?

Bundle params = new Bundle();
/* make the API call */
params.putByteArray("source", byteArray); 
params.putString("caption", "Titulo");
params.putBoolean("published", true);

new GraphRequest(AccessToken.getCurrentAccessToken(), "/me/photos", params, HttpMethod.POST, new GraphRequest.Callback() {
    public void onCompleted(GraphResponse response) {
        Log.i(TAG, response.toString());
    }
}).executeAsync();
    
asked by anonymous 03.08.2015 / 23:09

1 answer

1

The privacy level (audience in the Android SDK) is set when the user authorizes your app with write permission and can not be changed by your application.

When you request write permission, you can set the desired audience. Excerpt from the RPSSample example that ships with the SDK:

LoginManager.getInstance()
.setDefaultAudience(DefaultAudience.FRIENDS)
.logInWithPublishPermissions(RpsFragment.this, Arrays.asList(ADDITIONAL_PERMISSIONS));

The audience level you are looking for is DefaultAudience.EVERYONE . link

    
04.08.2015 / 01:23