我想让我的应用程序在我的墙上发布,我可以发布没有任何问题,但我不知道如何弹出
这是我的代码
$attachment = array(
'message' => 'Did a Test Post :',
'name' => "This is the title of my post",
'link' => "http://www.lydiadana.com.br",
'description' => htmlentities($linha['post_content']),
'picture'=> IMG_DIR . $file,
'auto_publish' => false,
'user_prompt_message' => 'Share your thoughts about RELL',
);
$facebook->api('me/feed', 'POST', $attachment);
我试过auto_publish,但没有成功,任何想法?我已经附上了一张图片,展示了我想要的东西。
答案 0 :(得分:2)
这不是通过PHP API完成的,它是通过Javascript API完成的!
FB.ui(
{
method: 'stream.publish',
message: 'getting educated about Facebook Connect',
attachment: {
name: 'Connect',
caption: 'The Facebook Connect JavaScript SDK',
description: (
'A small JavaScript library that allows you to harness ' +
'the power of Facebook, bringing the user\'s identity, ' +
'social graph and distribution power to your site.'
),
href: 'http://github.com/facebook/connect-js'
},
action_links: [
{ text: 'Code', href: 'http://github.com/facebook/connect-js' }
],
user_message_prompt: 'Share your thoughts about Connect'
},
function(response) {
if (response && response.post_id) {
alert('Post was published.');
} else {
alert('Post was not published.');
}
}
);
http://developers.facebook.com/docs/reference/javascript/FB.ui