简体   繁体   中英

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. 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. 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/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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