Is it possible to upload a photo to fanpage album

2019-01-24 19:14发布

Here on my fanpage I've added my small app, that makes it possible, that fans can upload photos to a special photo album of this fanpage.

It's possible, cuz I use a fanpage admin permission ("manage_pages, publish_stream and offline_access").

But now - everytime someone uses this app, I get a photo publish news feed on my fanpage. How can I add a photo to a fanpage WITHOUT publish it to the newsstream?

Actually my publish php code looks like:

<?php
  $post_data = array(
    'image' => ('@' . realpath($photo)),
    'message' => $msg)
  );

  $facebook->setAccessToken(_FANPAGE_ACCESS_TOKEN);
  $data = $facebook->api('/'. _ALBUM_ID . '/photos', 'post', $post_data);
?>

When I remove the "publish_stream" permission with my fanpage admin account - there will appear a 'funny' bug. The uploaded photo won't show up in the photo album and not in the news stream. But it is in the photo-strip where you see all new photos and when you click on it, it will be in a row with all those uploaded photos... it looks like, that it is somewhere in a 'hidden' photoalbum.

So does anyone have a clue, how to post photos over the graph api without publish it to the news stream?

Thanks in advance, Jurik

2条回答
可以哭但决不认输i
2楼-- · 2019-01-24 19:57

You could delete the news feed stream post immediately after upload (if its not returned when you create it). If you call the graph api: https://graph.facebook.com/269434846409322/feed?access_token=... you can get a list of feed posts and then you could issue an HTTP DELETE to the item you want to delete, like https://graph.facebook.com/269434846409322_269690926383714.

查看更多
唯我独甜
3楼-- · 2019-01-24 20:13

I got the solution! Nowhere in the docs is it mentioned - if you don't want post a feed when you upload a photo via Graph API set following parameter: no_story=1

This information was earlier here: http://developers.facebook.com/docs/reference/api/photo/

But somehow it disappeard from this doc. :(

source: Can I upload photos but not post to wall in Facebook?

How to contact FB so that they add this VERY important info?

查看更多
登录 后发表回答