简体   繁体   中英

Facebook Auto wall Posting

I have implemented Facebook Like stream, in which users can post status, photos and URL's on their stream. Now I have given an option to post on Facebook as well. I have given a checkbox and on clicking the Post Button it will check the checkbox value,if its checked then it will post on facebook as well. This has done successfully,but its showing Facebook Feed Dialog, I want to post automatically without showing the Feed Dialog Below code I am using on post button

 if ($("#fbpostcheck").attr("checked")) {
  FB.ui({
                        method: 'feed',
                        link: 'http://mywebsite.com',
                        picture: 'my image',
                        name: 'Stream',
                        caption: "FB post",
                        description: "User Entered Description"
                    }, function (response) { });
 }

Is it possible to auto post on FaceBook without showing feed dialog?

You've use the Dialog that's why it is showing the Dialog. Use FB.api instead.

( Note: You can only post on the current user's wall, not to his/her friends- that has been disabled by the facebook now.)

To post on the user's wall, you can simply use-

FB.api('/me/feed', 'post', { link: 'http://mywebsite.com', picture: 'my image', ETC..}, function(response) {
   if (!response || response.error) {
      alert('Error occured');
   } else {
      alert('Post ID: ' + response.id);
   }
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM