简体   繁体   中英

post to facebook page with photos

We have been developing server program written in PHP which post some information to Facebook Page periodically. It runs on Linux server as a daemon.

At first, we tried to post information to personal Facebook wall. Sometime there are some photos, so we create album to upload more than two photos.

This works fine. So, we tried to post to Facebook Page.

Then, we met some trouble.

Text only information can be posted correctly. But when we post with a photo, Facebook Page shows as attachment file. And it shows posted from personal account not from application.

In case of more than two photos, album creation fails as error(Invalid ID for album owner).

Our code is as follows,

$album = $facebook->api('/' . $id . '/albums','POST',array("name" => 'xxxx'........);

This works fine in case of personal Facebook wall.

Please advice for us.

Thanks.

首先尝试使用FB的Graph API Explorer,应该是这样的

$album = $facebook->api('/' . $id . '/photos','POST',array("message" => 'your text here'........);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM