在FB上共享图像(作为普通帖子),但“不作为链接”

时间:2016-05-04 05:56:10

标签: javascript facebook facebook-javascript-sdk

我想在FB上分享一张图片(作为普通帖子),上面有一些标题我用它来分享

<script src="//connect.facebook.net/en_US/all.js"></script>
<script>
FB.init({ appId: '660612734042393', status: true, cookie: true, xfbml: true, oauth: true });

function postToWall() {  
  FB.login(function(response) {
    if (response.authResponse) {
      FB.ui({
        method: 'feed', 
        picture: 'http://searchengineland.com/figz/wp-content/seloads/2015/10/google-panda-name3-ss-1920-800x450.jpg',
        caption: 'Checkout the image ',
        description: 'Checkout the image Checkout the image Checkout the image .'
      },
      function(response) {
        if (response && response.post_id) {
          alert('Post was published.');
        } else {
          alert('Post was not published.');
        }
      });
    } else {
        //alert('User cancelled login or did not fully authorize.');
      }
    }, {scope: 'publish_actions,email'});
  return false;
}
<a href="#" onclick="return postToWall();"><img type="button" src="../img2/shareFb.png"style="width: 109px;height: 50px;" ></a>

当我使用此分享图像时,它会像这样共享 The image I shared using the above code

这会像链接一样被共享,而不是像我们在FB上那样分享这个图像像普通的图像一样

The way I want to share the image

我已经检查了FB sdk,但没有找到确切的解决方案。 任何帮助将不胜感激

0 个答案:

没有答案
相关问题