Yu Lu
Yu Lu

Reputation: 330

Upload a photo in my app using Facebook Android API, but not shown to public

I have integrated Facebook login in my Android app, and successfully uploaded photos to my Facebook album using the in-app login. However I wish the shared photos would be public to all of my audience, but the default is shown to the user only. What should I do for this problem?

Upvotes: 1

Views: 649

Answers (1)

Yu Lu
Yu Lu

Reputation: 330

The codes are modified from the facebook sdk samples. The other problem I just found is that I can only use my own account to authorize the app (as the app administrator), my friends could not log in use their account.

private void postPhoto() {
    if (hasPublishPermission()) {
        Bitmap image = BitmapFactory.decodeFile(bitmapPath);
        Request request = Request.newUploadPhotoRequest(Session.getActiveSession(), 
                  image, new Request.Callback() {

            @Override
            public void onCompleted(Response response) {
                showPublishResult(response.getError());
                dialog.dismiss();
            }

        });
        //add progress bar here!
        showDialog(0);
        request.executeAsync();

    } else {
        pendingAction = PendingAction.POST_PHOTO;
    }
}

Upvotes: 3

Related Questions