Android Facebook version 4.0 open graph post bitmap failing

user3621075

I have the code below attempting to post an Open Graph story with attached bitmap image. The Bitmap is about 1 Meg in size so is within the Facebook limitation. The Share Dialog is displayed and the post will work but with no image showing! I do have appropriate provider entry in the manifest and I get no reported errors. Any thoughts on what may be wrong?

        // get App Facebook namespace
        final String fbNamespace = gameIdentity.getFbNamespace();

        // Create an object
        ShareOpenGraphObject.Builder object = new     ShareOpenGraphObject.Builder()
                .putString("og:type", fbNamespace + ":board")
                .putString("og:title", params.getString("name"))
                .putString("og:description", params.getString("caption"))
                .putString("og:url", "https://facebook.com/Example");


        // if we have an image, add to graph object
        if (image != null) {
            // build Photo object
            SharePhoto photo = new SharePhoto.Builder()
                    .setBitmap(image)
                    .setUserGenerated(true)
                    .build();
            // add to graph object
            object.putPhoto(fbNamespace + ":board", photo);
        }

        // Create an action
        ShareOpenGraphAction action = new ShareOpenGraphAction.Builder()
                .setActionType(fbNamespace + ":complete")
                .putObject("board", object.build())
                .build();

        // Create the content
        ShareOpenGraphContent content = new ShareOpenGraphContent.Builder()
                .setPreviewPropertyName("board")
                .setAction(action)
                .build();

        // initiate share process
        ShareDialog shareDialog = new ShareDialog(this);
        shareDialog.show(content);
Vrashabh Irde

Well try to use

  // add to graph object
    object.putPhoto("og:image", photo);

or use

SharePhotoContent content = new SharePhotoContent.Builder()
        .addPhoto(photo)
        .build();

But you have to have the facebook app v7.0 and above installed on the phone

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Android - Post Bitmap to Facebook

From Dev

Custom Open Graph Story failing Facebook review

From Dev

Why is Facebook post batching failing with GraphBatchException - #0?

From Dev

Why is Facebook post batching failing with GraphBatchException - #0?

From Dev

Facebook Open Graph Refresh

From Dev

Open Graph data facebook

From Dev

Migrating to Facebook PHP SDK v4, Open Graph

From Dev

Migrating to Facebook PHP SDK v4, Open Graph

From Dev

Facebook Graph API PHP SDK v4 - Post on Page

From Dev

Android - Facebook Open Graph Share Dialog opens, then crashes

From Dev

Facebook Android SDK 3.8 : Publish open graph story

From Dev

Facebook (on Android) Open Graph posts twice on activity log

From Dev

How to using Open Graph of Facebook SDK to like an Url in Android

From Dev

Android : Getting a Bitmap from a url connection (graph.facebook.com) that redirects to another url

From Dev

Facebook SDK 4.x Android Post as Facebook Page

From Dev

Facebook SDK 4.x Android Post as Facebook Page

From Dev

Facebook - Meta tags (open graph)

From Dev

Facebook Open Graph weird descriptions

From Dev

facebook open graph for each product

From Dev

Facebook Graph API Post with a place

From Dev

Retrofit failing to post on samsung s3 android version 4.0.4 while on data

From Dev

Open facebook page from android app (in facebook version > v11)

From Dev

Automatically post on wall - Facebook Graph API PHP SDK v4

From Dev

Facebook SDK v4 and Graph Api 2.x auto post in Fan Page Wall

From Dev

Facebook SDK v4 and Graph Api 2.x auto post in Fan Page Wall

From Dev

Rails 4 Api Users Post test failing

From Dev

android - post to facebook group

From Dev

android - post to facebook group

From Dev

Post On Facebook Wall With Android

Related Related

  1. 1

    Android - Post Bitmap to Facebook

  2. 2

    Custom Open Graph Story failing Facebook review

  3. 3

    Why is Facebook post batching failing with GraphBatchException - #0?

  4. 4

    Why is Facebook post batching failing with GraphBatchException - #0?

  5. 5

    Facebook Open Graph Refresh

  6. 6

    Open Graph data facebook

  7. 7

    Migrating to Facebook PHP SDK v4, Open Graph

  8. 8

    Migrating to Facebook PHP SDK v4, Open Graph

  9. 9

    Facebook Graph API PHP SDK v4 - Post on Page

  10. 10

    Android - Facebook Open Graph Share Dialog opens, then crashes

  11. 11

    Facebook Android SDK 3.8 : Publish open graph story

  12. 12

    Facebook (on Android) Open Graph posts twice on activity log

  13. 13

    How to using Open Graph of Facebook SDK to like an Url in Android

  14. 14

    Android : Getting a Bitmap from a url connection (graph.facebook.com) that redirects to another url

  15. 15

    Facebook SDK 4.x Android Post as Facebook Page

  16. 16

    Facebook SDK 4.x Android Post as Facebook Page

  17. 17

    Facebook - Meta tags (open graph)

  18. 18

    Facebook Open Graph weird descriptions

  19. 19

    facebook open graph for each product

  20. 20

    Facebook Graph API Post with a place

  21. 21

    Retrofit failing to post on samsung s3 android version 4.0.4 while on data

  22. 22

    Open facebook page from android app (in facebook version > v11)

  23. 23

    Automatically post on wall - Facebook Graph API PHP SDK v4

  24. 24

    Facebook SDK v4 and Graph Api 2.x auto post in Fan Page Wall

  25. 25

    Facebook SDK v4 and Graph Api 2.x auto post in Fan Page Wall

  26. 26

    Rails 4 Api Users Post test failing

  27. 27

    android - post to facebook group

  28. 28

    android - post to facebook group

  29. 29

    Post On Facebook Wall With Android

HotTag

Archive