I'm currently using the Facebook SDK 3.0.1 for Android to post photos on Facebook. To upload my photos I'm invoking the method:
Request.newUploadPhotoRequest(session, screenShot, new Request.Callback() {});
The photo is posted on Facebook immediately, however only with the properties/permission "Only Me" instead of "Public" "Your Friends".
Do you know how to change this? Are there some permissions missing?
UPDATE - my solution
Session.openActiveSession(this, true, new Session.StatusCallback() {
@Override
public void call(Session session, SessionState state, Exception exception) {
if ( exception != null )
{
//Log exception here
return;
}
if ( state == SessionState.OPENED ) {
List<String> permissions = new ArrayList<String>();
permissions.add("photo_upload");
session.requestNewReadPermissions(new Session.NewPermissionsRequest(MainActivity.this, permissions));
Toast.makeText(MainActivity.this, R.string.facebook_login_succeeded_message, Toast.LENGTH_LONG).show();
}
else if ( state == SessionState.CLOSED ) {
}
else if ( state == SessionState.OPENED_TOKEN_UPDATED) {
}
}
});