O'Reilly logo

Facebook Application Development with Graph API Cookbook by Apeksha Singh, Shashwat Srivastava

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Prompting the user to publish a story

If we want to publish a story or news piece on the wall of the current user by using an already built interface, we can do so with the help of Facebook Dialogs. It provides us with a ready to use interface which can be displayed to the user and finally used to publish any post.

Getting ready

You should have created index.php as mentioned in the beginning of this chapter.

How to do it...

The following steps will demonstrate how to publish a story:

  1. Open index.php and add the following highlighted code inside the div named fb-root as shown:
    <div id="fb-root">
      <input type="button" id="launch" value="Launch" /><br />
    </div>
  2. Next, add the following highlighted code to the function assigned to window.fbAsyncInit, just ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required