Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
429 views
in Technique[技术] by (71.8m points)

php - Is it possible to upload a photo to fanpage album without publishing it?

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...