views:

36

answers:

0

Hi,

My FB.ui stream.share and stream.publish work perfectly but when I call the Callback funcion, it always returns as error, even though the story is published on my Facebook profile.

       [script] <div id="fb-root<?php the_ID();?>"></div>
       <script>
                window.fbAsyncInit = function() {
                FB.init({appId: '151136734905815', status: true, cookie: true, xfbml: true});
                };
                (function() {
        var e = document.createElement('script'); e.async = true;
        e.src = document.location.protocol +
          '//connect.facebook.net/en_US/all.js';
        document.getElementById('fb-root<?php the_ID();?>').appendChild(e);
         }());

       function fb_share (url, title){
         var share = {
           method: 'stream.share',
           display: 'dialog',
           u: url,
           t: title
         };

         FB.ui(share, function(response) {
          if (response && response.post_id) {
           alert(response.post_id);
           } else {
             alert('Error: Post was not published due to some error. Please try again later.');
           }

           });
       }
        </script>[/script]

It always returns Error: Post was not published due to some error. Please try again later. even though the story is in facebook successfully. Any help on this?