简体   繁体   中英

Post dialog on Facebook wall and Facebook page

I am using facebook sharing API that post dialog on user wall after user login..
For example user come my site and like some thing and it share on his facebook wall..
But now I need when user share this on his wall then at a time same description will be share on facebook page that I made for my website .. so it is possible at a time same share post on user wall and a facebook page?

I am using facebook SDK sharing API...

FB.init({appId: "my app id" status: true, cookie: true});
var obj = { method: 'feed', 
            link: 'http://example.php',
            picture: 'http://example.php/images/logo.png',
            name: 'Rate the best Brewery in town',
            message:'helloo how are you ??',
            caption: 'drinkbeer.in',
            description: 'I just gave a thumbs up to ('+shop_name+') on DrinkBeer.In/Asheville What is your favorite place? Vote NOW!!'
          };

function callback(response) 
{  
   if (response && response.post_id) 
   {
       alert(response.post_id);
   } 
}

Yes.

After your above post is completed, you can simply make another call to publish on the fan page . Just like:

FB.api("/pageid/feed", params);

Just like this:

function callback(response) 
{  
   var obj = <YOUR_PARAMETERS>;

   if (response && response.post_id) 
   {
       alert(response.post_id);
       FB.api("/<YOU_PAGE_ID>/feed", 'post', obj, function(response) {
         if (!response || response.error) {
             alert('Error occured');
         } else {
             alert('Post ID: ' + response.id);
         }
       });
   } 
}

Permissions required: manage_pages , publish_stream

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