我正在尝试获得一个简单的 facebook 等设置以及视频的动态链接。下面的视频功能(publishVidToFB())效果很好!但是,除了我之外,我无法让这种地狱般的“喜欢”为任何人工作。
该应用程序未处于沙盒模式。喜欢对我来说很好,但我的评论没有通过。对于此处未在应用程序上设置为“Facebook 开发人员”的其他开发人员 - 在他们的新闻源中根本不会出现喜欢的内容。
FB 调试器只抱怨 og:image 标记中的图像大小。
请参阅下面的代码,请提供帮助!
!DOCTYPE html
html
*head*
*meta property="fb:app_id" content="app id is here" *
*meta property="og:url" content="link back to the originating page is here... "*
*meta property="og:site_name" content="site name code is here like 'INTERNALCODE'"*
*meta property="og:image" content="web linkable image is here"*
*meta property="og:description" content="description blah blah."*
*meta property="og:type" content="company"*
*meta property="og:title" content="blah blah blah"*
*/head*
*body*
*div id="fb-root"**/div*
*input type="button" value="Publish" onclick="publishVidToFB(); return false;" *
*script*
window.fbAsyncInit = function() {
FB.init({
appId : 'my appid is here', // App ID
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
oauth : true, // enable OAuth 2.0
xfbml : true // parse XFBML
});
};
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id; js.async = true;
js.src = document.location.protocol + "//connect.facebook.net/en_US/all.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
function publishVidToFB(){
FB.ui({
method: "stream.publish",
user_message_prompt: "",
message: "message",
attachment: {
name: "Check out this cool video",
caption: "Video caption goes here etc etc etc",
href: "my href is here",
media:[{
"type": "image",
"src": "image source is here",
"href": "myhref is here"
}]
}
});
};
*/script*
*div class="fb-like" data-href="href is here" data-send="false" data-width="450" data-show-faces="false"**/div*
*/body*
/html