1

我们正在编写一个 facebook 应用程序,当人们参加比赛时,它会在人们的墙上创建一个帖子。我们在创建帖子的内容时遇到问题。

状态消息和链接按预期运行,但是图片、名称、标题和描述是从帖子链接到的页面中获取的。

这是我们用来发布到人们的墙的代码:

$facebook->api("/me/feed", "post", array(
    message => "I've just chosen my kangaroo to win a ticket to the Caravan, Camping and Off-Road Sale at the Adelaide Showgrounds (August 2-5). Be quick, there are only 1000 tickets up for grabs! Just click the link below.",
  picture => "http://gmbo.com.au/hosted/cca/pak/app-icon.png",
   link => "http://www.facebook.com/pages/WEIM-Sandbox-2/241942125896015?sk=app_416990981685156",
    name => "CLICK HERE",
    caption => "If you love caravans, camping or outdoor recreation - you'll love this Show.",
    description => "If you love caravans, camping or outdoor recreation - you'll love this Show."

任何帮助将不胜感激,这个 Facebook API 的东西可能非常令人沮丧。

谢谢

4

2 回答 2

2

您缺少' '每个属性。此外,您忘记关闭括号。

$facebook->api("/me/feed", "post", array(
    'message' => "I've just chosen my kangaroo to win a ticket to the Caravan, Camping and Off-Road Sale at the Adelaide Showgrounds (August 2-5). Be quick, there are only 1000 tickets up for grabs! Just click the link below.",
    'picture' => "http://gmbo.com.au/hosted/cca/pak/app-icon.png",
    'link' => "http://www.facebook.com/pages/WEIM-Sandbox-2/241942125896015?sk=app_416990981685156",
    'name' => "CLICK HERE",
    'caption' => "If you love caravans, camping or outdoor recreation - you'll love this Show.",
    'description' => "If you love caravans, camping or outdoor recreation - you'll love this Show."
));

如果它仍然不起作用,请检查您是否publish_stream在 fbmain.php 中获得了许可。

您可以参考PHP SDK 和 JavaScript SDK Feed Dialog获取更多示例。

于 2012-07-20T08:02:39.613 回答
-1

这段代码没有任何问题。你不需要引号。

这是一个 Facebook API 错误。我们尝试了您提到的内容,但有一个已知的错误。我们试图做的事情过于雄心勃勃,以至于可怜的小 Facebook 无法包裹它的小脑袋。

于 2012-07-28T04:49:49.867 回答