Usando FB.ui para publicar en el muro de la página

Estoy usando 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 {

     }
   }
 );

preguntado el 09 de enero de 11 a las 00:01

What should the picture be? Im putting a direct url to a image on my server but it does not show uo. is that not what its meant to do? -

6 Respuestas

Entiendo:

you have to set the to y from valores:

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 {

    }    
   }  
);

Respondido 13 Jul 13, 05:07

This code does not work. (Unless the user has liked the page first) also the feed from dialog is a special case that only works for page administrators. developers.facebook.com/docs/reference/dialogs/feed - Plastic Sturgeon

This doesn't work for me, either - I set the from and to to be the page's ID - I'm impersonating that page on Facebook but get the error: - Ian Grainger

I used the JavaScript SDK to post on user's wall:

function graphStreamPublish(){
           var body = document.getElementById("txtTextToPublish").value;
            FB.api('/me/feed', 'post', { message: body }, function(response) {
                if (!response || response.error) {
                     alert('Error occured');
                } else {
                     alert('Post ID: ' + response.id);
                }
           });
     }

When I go through the Graph API Page I think if you change '/me/feed/' a 'pageId/feed' then it may post the message in that page. I am not sure. - just a suggestion.

Respondido 13 Jul 13, 05:07

Yeah, I tried that. I was looking for the FB.ui popup, though. :-) - jchapa

If you check out the link I posted above, it shows you how to get the popup using jquery+FB.ui. - agachadiza

The problem with this code is it shows up to publish to a user's wall. The question is how to use FB.ui to publish to an application page which is not the same thing. - haskovec

To share on a friend's wall, as of February 2012:

FB.ui({
    method: 'stream.publish',
    app_id: appId,
    display: 'iframe',
    name: name,
    link: link,
    picture: picture,
    caption: caption,
    description: description,
    target_id: friendIds
});

Respondido 13 Jul 13, 06:07

stream.publish going to be deprecated, isn't it? - superscral

Yes it is unfortunately, didn't check yet for the new solution, I will when I need it again. - NaturalNacidoCamper

To post to facebook wall use the following.. .

Call the below js function using simple call as in below

<a href="#" onclick="publishWallPost()">Post to Wall image/text?</a> 


//facebook: post to wall 
function publishWallPost() {

      FB.ui({
          method: 'feed',
          name: 'Your App Name',
          caption: 'Caption Text',
          description: 'Your description text',
          link: 'https://www.facebook.com/link/link.link',
          picture: fbImg
        },
        function (response) {
          console.log('publishStory response: ', response);
        });
      return false;
}


window.fbAsyncInit = function () {
      FB.init({
        appId: 'Your App ID',
        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').appendChild(e);
}());

respondido 11 nov., 13:08

Sorry, this is an old question, but I thought this might be helpful for people who find it via google. http://fbmhell.com/2011/07/facebook-share-popup-iframe-tabs-jquery/

Respondido el 21 de Septiembre de 11 a las 11:09

The reply is 2 years old - not sure it warrants a -1 for that. Anyway, the updated link is here: snipe.net/2011/07/facebook-share-popup-iframe-tabs-jquery - agachadiza

Just remember target_id needs to be parsed into an int. The response["to"] comes back as a string.

Respondido 11 Abr '12, 17:04

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.