Using FB.ui to post to Page wall

jchapa picture jchapa · Jan 9, 2011 · Viewed 32.8k times · Source

I'm using FB.ui to post to a Facebook user wall. However, I am uncertain on which parameters to use to post to a Page or Application wall. Any links?

I am trying to post to the Page wall as that page, not as the user's account.

Code to post to user account:

 FB.ui(
   {
     method: 'feed',
     name: name,
     link: link,
     picture: picture,
     caption: caption,
     description: redemption,
     message: message
   },
   function (response) {
     if (response && response.post_id) {
       alert(response.post_id);
     } else {

     }
   }
 );

Answer

jchapa picture jchapa · Jan 11, 2011

Got it:

you have to set the to and from values:

FB.ui(    {
  method: 'feed',
  name: name,
  link: link,
  picture: picture,
  caption: caption,
  description: redemption,
  message: message,
  to: page_id,
  from: page_id    
 },    
function (response) {
    if (response && response.post_id) {
      alert(response.post_id);
    } else {

    }    
   }  
);