Pinterest facebook如何邀请盒子生成?

时间:2013-07-25 03:30:53

标签: facebook

我一直在尝试使用此代码将Pinterest的发送消息复制给用户:

    FB.ui({
    method: 'send',
    name: 'The Image',
    display: 'popup',
    description: 'Description here',
    link: 'http://www.mywebsite.com/',
});

弹出框显示但我无法控制描述,名称和显示用户缩略图的图片。

弹出框显示我网站的描述,名称和页面中的随机图像。

这是一张图片http://postimg.org/image/8o01c3vfr/

如何获取弹出窗口以显示用户缩略图和自定义说明及名称?

更新:我试过这个但仍然没有希望!

<html>
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# article: http://ogp.me/ns/article#">
<meta property="fb:app_id" content="app id" /> 
<meta property="og:title" content="Your title">
<meta property="og:description" content="Your Desc.">
<meta property="og:image" content="http://2.bp.blogspot.com/-Z-yBlXMMYWo/UBUYe-Lc46I/AAAAAAAAAxc/VO9XB7Ls-sY/s640/Under+water.JPG">
<meta property="og:image:secure_url" content="http://2.bp.blogspot.com/-Z-yBlXMMYWo/UBUYe-Lc46I/AAAAAAAAAxc/VO9XB7Ls-sY/s640/Under+water.JPG">
<meta property="og:image:type" content="image/png">
<meta property="og:image:width" content="150">
<meta property="og:image:height" content="150">
</head>
<body>

<div id='fb-root'></div>

<script>
  // Load the SDK asynchronously
  (function(d, s, id){
     var js, fjs = d.getElementsByTagName(s)[0];
     if (d.getElementById(id)) {return;}
     js = d.createElement(s); js.id = id;
     js.src = "https://connect.facebook.net/en_US/all.js";
     fjs.parentNode.insertBefore(js, fjs);
   }(document, 'script', 'facebook-jssdk'));

window.fbAsyncInit = function() {
    FB.init({appId: "app id", status: true, cookie: true, xfbml: true,   frictionlessRequests : true});

};

function send_message() {
    FB.ui({
        method: 'send',
        name: 'The Image',
        display: 'popup',
        description: 'Description here',
        link: 'http://www.website.com/',
        picture: 'http://www.website.com/image.png'
    });
}
</script>
<a href='#' onclick='send_message();'>send</a>

</body>
</html>

1 个答案:

答案 0 :(得分:0)

尝试在<head></head>块中使用开放图元标记:

<meta property="og:title" content="Your title">
<meta property="og:description" content="Your Desc.">
<meta property="og:image" content="http://YOURWEBSITE.com/YOURIMAGE.png">
<meta property="og:image:secure_url" content="https://YOURWEBSITE.com/YOURIMAGE.png">
<meta property="og:image:type" content="image/png">
<meta property="og:image:width" content="150">
<meta property="og:image:height" content="150">