Post to facebook wall using API Graph and missing share button

前端 未结 2 1358
臣服心动
臣服心动 2020-12-17 05:08

Is it possible to post a message with share button in Graph API. I use SDK-PHP v3 and this code:

    $args = array(
        \'access_token\' => TOKEN_HERE         


        
2条回答
  •  囚心锁ツ
    2020-12-17 05:44

    ok, I found solution. maybe someone will be interested. to add a link with share button you have to use 'me/links' instead of 'me/feed'.

    $attachment = array(
        'access_token'=>TOKEN_HERE,
        'message'=>'message_here',
        'link' => 'http://www.example.com/',
    );
    
    $result = $facebook->api(
        'me/links',
        'post',
        $attachment
    );
    

提交回复
热议问题