3

I'm building application to post statuses from authenticated users like that one.

The problem is the application posting from my profile on friends wall who authenticated the application from my profile.

I'm using Facebook API with CodeIgniter.

the code

            $userId = $this->facebook->getUser();
        $IDs = $this->facebook_data->get_IDs();
        if(isset($_POST['link'])){
            $args = array(
                'from'  => array('name'=>'Resala','id'=>'294357147348261'),
                'application'=>array('name'=>'XXXX','id'=>'XXXXX'),
                'name'  =>'XXXX',
                'message'   => $_POST['status2'],
                'link'      => $_POST['link']
            );
        }else{
            $args = array(
                'from'  => array('name'=>'Resala','id'=>'294357147348261'),
                'application'=>array('name'=>'Resala','id'=>'XXXXX'),
                'name'  =>'XXXX',
                'message'   => $_POST['status1']
            );
        }
        foreach($IDs->result() as $row){
            $ID=$row->user_id;
            $this->facebook->api("/$ID/feed", "post", $args);
        }
4

1 回答 1

1

创建帖子的正确文档是:http:
//developers.facebook.com/docs/reference/api/user/#posts

在那里您可以看到参数“来自”和“应用程序”不存在以及“名称(只有在指定链接时才能使用)”。

不能以应用的名义发帖。您只能以页面的名称(可能与应用程序相关联)发帖。因此,您必须使用页面访问令牌而不是用户访问令牌。请参阅:http: //developers.facebook.com/docs/reference/api/page/#page_access_tokens

于 2012-12-14T10:56:34.943 回答