按照Facebook是deprecating all FBML apps soon,我劝你look here,并尝试以这种方式创建一个对话框。我可以给你我正在使用的脚本,你圈出的链接指向我的应用的主页。应该做一个笔记 - 我的应用程序是一个Iframe应用程序。
<script type="text/javascript">
FB.ui(
{
method: 'stream.publish',
attachment: {
name: 'name',
caption: 'caption',
source: 'picture.jpg',
picture: 'picture.jpg',
description: 'description',
href: 'http://apps.facebook.com/appname'
},
action_links: [
{ text: 'name', href: 'http://apps.facebook.com/appname' }
]
},
function(response) {
if (response && response.post_id) {
alert('Post was published.');
} else {
alert('Post was not published.');
}
}
);
</script>
不过,若你要保持你的应用在FBML形式,试试这个代码:
<script type="text/javascript">
FB.ui(
{
method: 'stream.publish',
attachment: {
name: 'name',
caption: 'caption',
source: 'picture.jpg',
picture: 'picture.jpg',
description: 'description',
href: 'http://apps.facebook.com/appname/index.php'
},
action_links: [
{ text: 'name', href: 'http://apps.facebook.com/appname/index.php' }
]
},
function(response) {
if (response && response.post_id) {
alert('Post was published.');
} else {
alert('Post was not published.');
}
}
);
</script>
您需要了解iFrame和FBML应用程序之间的区别:虽然的Iframe应用软件可以使用户始终保持在同一页面中,并且只有Iframe中的内容发生更改,FBML应用程序实际上将用户从一个页面移动到另一个页面。因此,在FBML应用程序中指定链接时,使用http://apps.facebook.com/appname/page
链接而不是http://www.yoursite.com/page
链接很重要。
实例链接:
- 在您的网站的链接:
http://www.yoursite.com/game1.php
- 看起来像这样在FBML应用:
http://apps.facebook.com/appname/game1.php
检查$ canvasURL广告$ tale_id那什么是变量在他们的价值。它可能发生,他们指向任何其他应用程序。只是回声这些变量,并看到他们的价值 – 2011-01-31 12:02:50
这些都很好,但我认为在某些设置有一些问题,但不明白从哪里我可以设置此 – Hafiz 2011-01-31 12:13:21