0

I am developing an android app and am using the Facebook Android SDK 3. I have used the following example to post open graph actions :

https://github.com/fbsamples/android-3.0-howtos/blob/master/ObjectAPIHowTo/Complete/src/com/facebook/samples/shareoghowto/MainFragment.java

My object is a movie object and after every post, the activity log shows 2 things being posted :

<User> <my_action> a movie on Facebook
<User> posted a movie on Facebook

Is there a way I can only show up one action on the timeline :

<User> <my_action> a movie on Facebook

Showing up 2 for every one publish kinda comes out as story pollution for the user and not sure the user will really like this. Is there a way I can solve this ?

My Object creation code is :

private OpenGraphObject getFacebookMovieObject(Movie m) {

        OpenGraphObject object = OpenGraphObject.Factory.createForPost(OpenGraphObject.class,
                "video.movie", m.getTitle(), m.getImage(),
                “http://www.themoviedb.org/movie/”+m.getId(),
                m.getComments());

        return object;
}

I also tried the below code:

private OpenGraphObject getFacebookMovieObject(Movie m) {
        OpenGraphObject object = OpenGraphObject.Factory.createForPost("video.movie");

        object.setProperty("title", m.getTitle()); 
        object.setProperty("image", m.getImageLarge());
        object.setProperty("url", "http://www.themoviedb.org/movie/"+m.Id());
        object.setProperty("description", m.getComments());

        return object;
    }

Thanks :)

sharath
  • 3,501
  • 9
  • 47
  • 72

1 Answers1

2

Yes. You can actually just create the object inline once. Instead of doing an object create post and then following with a post using that id, you can just do one post and inline the object.

Dave Miller
  • 316
  • 1
  • 3
  • I even tried this : com.facebook.Request actionRequest = com.facebook.Request.newPostOpenGraphActionRequest(Session.getActiveSession(),action, actionCallback); actionRequest.setGraphObject(object); Even this doesnt work.. :( – sharath Jun 24 '14 at 23:59
  • Can you expand on what the "object" is? Perhaps edit your initial question to include more code so it's formatted better? – Ming Li Jun 25 '14 at 07:03
  • Can you reply with how you are using the object in question? Once it is built, you should not actually post it. You should pass it into the action post as the object. Instead of using the create object API and then taking the resultant id and passing that as the object to , you should just pass a JSON string representation of the object. Call object.getInnerJSONString().toString() – Dave Miller Jun 27 '14 at 21:24