【发布时间】:2014-06-14 18:14:50
【问题描述】:
我有一个像这样的开放图形对象页面:
<html><head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# music: http://ogp.me/ns/music#">
<title>OG Sample Object - Sample Song</title>
<meta property="fb:app_id" content="<?php echo FACEBOOK_APP_ID; ?>">
<meta property="og:title" content="<?php echo "MY SONG2"; ?>">
<meta property="og:image" content="https://s-static.ak.fbcdn.net/images/devsite/attachment_blank.png">
<meta property="og:url" content="<?php echo "{$_SERVER['REQUEST_SCHEME']}://{$_SERVER['SERVER_NAME']}{$_SERVER['REQUEST_URI']}"; ?>">
<meta property="og:type" content="music.song">
</head>
我使用 Javascript 来发布动作:
FB.api(
'me/my_custom_app_dev:my_action',
'post',
{
song: "http://" + location.hostname + "<?php echo SANDBOX_USER_PATH;?>" + "/component-details.php?type=song&id=1234",
tags: tagList.valueOf(), // tagged friend(s); if any
message: messageText // custom message; if any
},
function(response) {
// handle the response
if(response.id) {
alert('Successfully posted on Facebook timeline.');
} else {
alert('Sorry, Failed to post on Facebook timeline.');
}
}
);
动作已成功发布在我的时间线上,但我的 Facebook 墙上帖子的 URL 缺少此部分的参数 ?type=song&id=1234
我错过了什么吗?
【问题讨论】:
标签: facebook facebook-graph-api facebook-javascript-sdk