Question

I want to post to user time-line with their current activity with photo uploaded by them.

For example:

I voted 'xyz movie'.

..image1.. ..image2.. ..image3..

Question : Mutiple photos possible? If yes, Is there limit of photos.I need to show 3-5 photos

Similar to Candy crush saga game post: (just for reference,not exactly like this. For curiosity I wanted to know whether this is two posts?)

enter image description here

Which api can we use for this?

Is this possible with FB.ui feed api?

FB.ui(
  {
    method: 'feed',
    to:'the Facebook ID of the person you wanna send',
    name: 'Facebook Dialogs',
    link: 'http://emplido.com',
    picture: 'http://fbrell.com/f8.jpg',
    caption: 'Reference Documentation',
    description: 'Dialogs provide a simple, consistent interface for applications to interface with users.'
  },
  function(response) {
    if (response && response.post_id) {
      alert('Post was published.');
    } else {
      alert('Post was not published.');
    }
  }
);
Was it helpful?

Solution

What you want is called rich stories, you can create them with open graph, here you can see what are the options available.

This is no easy deal, since you have a lot of options, so you really need to read the open graph docs to find which action fits best. In the docs you have a complete "how to", including how to post an action on a users wall with graph api https://developers.facebook.com/docs/opengraph/using-actions/

Remember that you have to two types of actions, common (docs here) and custom (docs here)

I know that documentation isn't the best answer or the one you wanted to, but in this case it's really necessary, as I said before, you have too many options, that allows you to create the best user experience for your app.

Quoting the docs here's a little example on how to create a story with open graph

To publish an action, make an HTTP POST to the following Graph API endpoint:

 /{user-id}/{action-type}

This call should be signed with a user access token with publish_actions permission or with an app access token for a user who was previously logged in.

For common actions, the {action-type} is the name of the action, such as og.likes:

/{user-id}/og.likes

For custom actions, it is a composite of the app namespace and the custom action type:

/{user-id}/{namespace}:{action-type-name}

The namespace is unique to your app, and is set in your app's dashboard on the Basic tab.

This example is the simplest one.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top