Thursday, 16 January 2014

get response after sharing with Facebook feed dialog?

    <div id='fb-root'></div>
    <script src=''></script>
    <p><a onclick='postToFeed(); return false;'><img src="RANDOM IMAGE.png" alt="IMAGE"/></a></p>
    <p id='msg'></p>

          FB.init({appId: "1234567890", status: true, cookie: true});

          function postToFeed() {

            // calling the API ...
            var obj = {
              method: 'feed',
              link: '',
              picture: '',
              name: 'Facebook Dialogs',
              caption: 'Reference Documentation',
              description: 'Using Dialogs to interact with users.'

            function callback(response) {
              document.getElementById('msg').innerHTML = "Post ID: " + response['post_id'];
            }`enter code here`

            FB.ui(obj, callback);