doujingke4981 2012-07-18 09:27
浏览 91
已采纳

Facebook Post to Wall不发布图片

I have implemented exactly the code which is shown on this page: http://developers.facebook.com/docs/reference/dialogs/feed/

Problem: All the fields in the object are filled correctly, and also posted correctly to facebook, except the picture.

<?php

if(isset($_POST['successmessage'])) {

    echo '<div class="info_message" style="margin:0 10px 10px 10px">
            <div style="float:left;display:inline;width:200px">
                <strong>'.$lang['checkout_text_42'].' '.$lang['checkout_text_43'].'</strong>
                <br>'.$lang['checkout_text_44'].'
            </div>
            <div style="float:left;display:inline">
                <a onclick="postToFeed(); return false;" style="cursor:pointer;float:left"><img src="images/post-design-to-fb.png" style="margin-top:4px"></a>
                <div id="msg" style="line-height:34px;float:left;margin-left:10px"></div>
            </div>
            <div style="clear:left"></div>
        </div>';

    ?>

    <div id='fb-root'></div>
    <script src='http://connect.facebook.net/<?php echo $locale; ?>/all.js'></script>
    <script> 
      FB.init({appId: "123455666777", status: true, cookie: true });

      function postToFeed() {

        // calling the API ...
        var obj = {
          method: 'feed',
          link: 'http://www.mydomain.com/configurator.php?id=<?php echo $_SESSION['sharetofb'];?>&lang=<?php echo $language;?>',
          picture: 'http://www.mydomain.com/images/designs/design-<?php echo $_SESSION['sharetofb'];?>.png',
          name: 'I just designed a DIY T-Shirt. Awesome!',
          caption: 'Click to check it out and customize it.',
          description: 'Choose from 500 different materials, colors, prints, shapes to assemble your unique custom T-Shirt.'
        };

        function callback(response) {

            if (response && response['post_id']) {
               document.getElementById('msg').innerHTML = "Your design was posted successfully!";
             } 

        }

        FB.ui(obj, callback);
      }

    </script>

    <?php

}

?>

If I use the Direct URL Example given on the above mentioned facebook doc and copy/paste the url into the browser (substituted with my App ID and URL and content), it also shows everything except the picture.

The strange thing is: It showed and posted the picture yesterday. However after several times of testing and posting and deleting the the test posts from my wall, it didn't post the picture anymore.

I searched all the questions and answers here on stackoverflow and can exclude that it is a problem of having dashes in the picture url. I really cannot figure it out and are close to asuming that facebook is blocking post pictures if done too often??

Appreciate any hint which can lead me to the solution.

  • 写回答

1条回答 默认 最新

  • dqkelut8423 2012-07-18 10:50
    关注

    Have you tried to use a static picture? Is it working? Maybe it depends on the variable you pass to it.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥15 stable diffusion
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿