I would like to post to my user's wall using php sdk and the new Open Graph is there a way or I shall stick to the typical 'feed' method?
1条回答 默认 最新
doujiao3016 2012-04-28 14:50关注You can use the following code to post actions on timeline using open graph actions and objects.
<?php require "src/facebook.php"; $facebook = new Facebook(array( 'appId'=>'xxxxxxxxx', 'secret'=>'xxxxxxxxxxxxxxxxx', 'cookie'=>true )); if(!$facebook->getUser()) { $url = $facebook->getLoginUrl(array('scope'=>'publish_actions')); echo "<script> top.location=\"".$url."\"; </script>"; exit(0); } $params = array('article'=>'http://www.onlytipsandtricks.com.com/test.html','access_token'=>$facebook->getAccessToken()); $out = $facebook->api('/me/app_namespace:read','post',$params); print_r($out); ?>本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报