简体   繁体   中英

Facebook Graph Api posting on friends wall

I'm having a problem when trying to post a link to a friends wall using the Facebook graph from my application. I am currently using the Facebook SDK for PHP, I have no problems posting to the wall of the user that's logged in but cannot post to friends of the logged in user. I have requested the extended permission "publish_stream" and here is the code am I using:

$args = array('message' => $message,
                            'link' => 'google.com',
                            'name' => 'Test!',
                            'caption' => 'Please click on the link',
                            'description' => 'description');
$result = $facebook->api("/$friendId/feed", 'POST', $args );

$friendId has the facebook id of the friend of the logged in user, any help would be much appreciated.

A quick scan of the FB API reference shows that you can set the to key value pair in this operation to

mention or target a user in this post

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