Graph API new feed post object-Attachment not showing

前端 未结 4 984
名媛妹妹
名媛妹妹 2020-12-30 09:26

I\'m having a strange problem with the graph API, the below code used to work for me adding a post to a users news feed with a thumbnail of the attached photo (referenced in

4条回答
  •  别那么骄傲
    2020-12-30 09:50

    I think the 'object_attachment'=>$photo_id won't work any more. You should change it to 'picture'=>$photo_url

    $photo_Url = "link to your photo";//Valid Facebook Photo ID...        
    $facebook = new Facebook($config);
    
    $attachment =  array(
            'access_token' => $user_token,
            'message' => "Test Message",
            'caption' => "THis is a Caption",
            'name' => "Test Name",
            'description' => "This is a description",
            'link' => 'http://url.com/',
            'picture' => $photo_Url,
    );
    
    $response = $facebook->api("/".$userID."/feed/", 'POST', $attachment);
    

    You can find more Here

提交回复
热议问题