FeedStory form
From Facebook Developer Wiki
Contents |
Description
Facebook will deprecate this Feed form method December 20, 2009.
Please start using FB.Connect.streamPublish and Facebook.streamPublish instead.
The Feed story form is special FBML element that allows your application to publish approved Feed stories directly to a user's Wall. (You can publish directly to a user's friend's Wall with MultiFeedStory_form).
To use the Feed form, create a standard HTML <form> with this special fbtype="feedStory" attribute and a standard form input submit button. We intercept the submit click.
You need to provide an action callback. On form submission, we ping your callback and wait for a response from you containing the Feed story and the follow-up URL to where the user gets redirected after publishing or canceling the form. For example, the story is specified by $feed and the follow-up URL is specified by next in the JSON example below. Or you could pass next_fbjs instead and execute JavaScript after publishing or canceling.
Read more about Feed forms.
Attributes
| Required | Name | Type | Description | |
| required | fbtype | string | Must be "feedStory." | |
|---|---|---|---|---|
| action | string | The callback to a feedStory feed handler. |
Response Content
Facebook expects the following arguments from the response endpoint.
| Required | Name | Type | Description | |
| required | feed | array | The Feed story bundle. | |
|---|---|---|---|---|
| next | string | The page to load after the Feed dialog appears. | ||
| optional | next_fbjs | string | JavaScript to run after the form is done. (You can use this parameter instead of the next parameter.) |
Examples
Mood Picker
Mood Pick Handler (JSON PHP)
Mood Pick Handler (Ruby on Rails)
Notes
- The action of the form must be an absolute URL or the form will not render.
- If you are using Ruby On Rails version 1.2.x, use the JSON gem instead of the to_json method because the default Rails 1.2.x to_json method will render incorrectly formatted JSON output.
- If you see a Facebook error on your page that says "null" was returned in the JSON output from your callback page, it is most likely that the output rendered is not formatted correctly.
