libgdxfacebook-android-sdkandroid-sdk-toolsfacebook-sdk-4.0facebook-sdk-3.0

FacebookSDK on Android - SharePhotoContent with Message body


I have a button in my game where I make a finish level screen capture , I then attach that picture to a Facebook SharePhotoContent dialog from the newest SDK.

It all works as it's supposed but how do I also insert a custom message body so that I replace the standard "Say something about this photo" text in the body?

Here is the code :

File tmpFile = new File(path_to_saved_facebook);
media_scanner = new SingleMediaScanner(this, tmpFile);
Bitmap bitmap = BitmapFactory.decodeFile(path_to_saved_facebook, options);
SharePhoto photo = new SharePhoto.Builder()
        .setUserGenerated(true)
        .setBitmap(bitmap)
        .setCaption("Latest score")
        .build();
SharePhotoContent content = new SharePhotoContent.Builder()
        .addPhoto(photo)
        .build();
shareDialog.show(content);

enter image description here


Solution

  • You can't. Facebook does not allow you to prefill the status message.