我目前有以下代码。但图表api仍然返回(#120)无效的专辑ID。如果我查看$ facebook_album或https://developers.facebook.com/tools/explorer/248099655226775/?method=GET&path=213152142082066它会显示一张专辑。所以专辑确实存在。
public function save_facebook(){
Site::debug();
$album_item = new Foto_Album_Item($this['navigatie_obj']['parent_id']);
// File upload activeren
Site::$facebook->setFileUploadSupport(true);
// Facebook album ophalen
$facebook_album = Site::$facebook->api('/'.$album_item['facebook_id']);
// Facebook als gebruiker gebruiken ipv als applicatie
Site::$facebook->setAccessToken( Facebook::$user_access_token );
$user_id = Site::$facebook->getUser();
$facebook_options = array(
'source' => '@'.realpath(Site::$serverpath['album'].$this['navigatie_obj']['parent_id'].'/'.$this['bestand']),
'access_token' => Facebook::$user_access_token,
);
$request_method = '/'.$album_item['facebook_id'].'/photos';
$return = false;
try {
$result = Site::$facebook->api($request_method,'POST',$facebook_options);
$options = array('facebook_id' => $facebook_id ? $this['facebook_id'] : $result['id']);
$return = parent::save($options);
} catch(Exception $e){
Log::error($e,__FILE__,__LINE__);
}
return $return;
}
答案 0 :(得分:4)
为了能够上传到属于某个页面的相册,您应该检查(或更改)以下几项内容:
您收到的错误消息显然具有误导性
希望这会有所帮助