简体   繁体   English

Facebook php sdk - 张贴到提示墙

[英]Facebook php sdk - post to a wall with prompt

T'm writing a Facebook canvas app, and I'm trying to post to the user's wall. 我正在写一个Facebook画布应用程序,我正试图发布到用户的墙上。 this the code I'm using: 这个我正在使用的代码:

if ($user) { 

$attachment = array('message' => 'This is message',
                    'name' => 'Name of the message',
                    'caption' => 'Caption of link',
                    'link' => 'http://www.example.com/about',
                    'description' => 'Great site!',
                    'picture' => 'http://lorempixum.com/100/100/',
                    'actions' => array(array('name' => 'Do Something!',
                                      'link' => 'http://www.example.com'))
                    );

$result = $facebook->api('/me/feed/',
                            'post',
                            $attachment);
}

So I tested with 2 facebook accounts, and it posts to the wall but without the facebook dialog i'm always seeing. 所以我测试了2个Facebook帐户,它贴在墙上,但没有我总是看到的Facebook对话框。 I would like the user to be warned that I'm gonna post on the wall, and allow him to cancel it. 我希望用户被警告说我要张贴在墙上,并允许他取消它。

How do I do that? 我怎么做?

你需要使用JavaScript SDK,基本上是对话框: http//developers.facebook.com/docs/reference/dialogs/feed/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM