简体   繁体   中英

facebook PHP SDK posting as activity, not post

I hope you will be able to help me.

I'm developing an app, and I'm willing to post an activity (that appears on user timeline in recent activity) everytime the user use my application.

Although, for the moment, I have this code below, and it only posts a normal link :

if($can_post){ 
$facebook->api('/'.$uid.'/feed', 'post', array(  
'message' => '',  
'name' => 'Name',  
'caption' => 'Caption',
'description' => 'SDesc',
'picture' => 'picture url',
'link' => 'link',
'actions' => array(array('name' => 'catch phrase', 
 'link' => 'http://link'))
));   

Check out this guide on posting "stories" to the user's timeline using the Open Graph API, so maybe it's this functionality that you need. The example they give is just a like, but it can be easily modified.

Be aware that Facebook will have to approve you app again if you want to use stories (see end of page on link above).

It's also worth noting that Facebook have also defined a wide range of predefined " Actions " to help in the process, so it's a good idea to check to see if your app falls into one of these categories.

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