Facebook的iOS应用程序:使用“网络应用程序”通过Feed对话分享会导致裁剪图像

时间:2013-07-04 11:45:39

标签: ios facebook facebook-graph-api facebook-javascript-sdk

我们正在使用基本的Feed对话框来启用Facebook上的分享 - 标题,字幕描述和图片。

在台式机,Facebook的Android应用程序和移动网站上正确显示正确的图像并正确显示。

iOS正在挑选图像(它是一只手),但它也正在被裁剪。

在台式机,Facebook的Android应用程序和移动网站上正确显示正确的图像并正确显示。 Screenshot - not allowed to post images yet

背景

  • 图片位于Facebook首选的1500 x 1500
  • 我们使用的og:image标签并不完全是犹太洁食(我正在使用预备CMS并且控制有限)但我已经确认使用Facebook的调试器拾取图像

代码

元标记为<meta name="og:image" content="/EasysiteWeb/getresource.axd?AssetID=135801">

在页:

    <div id="fb-root"></div>
    <script src="http://connect.facebook.net/en_US/all.js"></script>
    <a onclick="postToFeed(); return false;"><img src="/EasysiteWeb/getresource.axd?AssetID=133763" alt="Share on Facebook"/></a>
    <p id="msg" style="display: none;"></p>

    <script>
//<![!CDATA[    
      FB.init({appId: "app-id-removed-for-posting-to-SO", status: true, cookie: true});

      function postToFeed() {

        // calling the API ...
        var obj = {
          method: "feed",
          redirect_uri: "http://www.hospicecareweek.org.uk/countmein",
          link: "http://www.hospicecareweek.org.uk/countmein",
          picture: 'http://www.hospicecareweek.org.uk/EasysiteWeb/getresource.axd?AssetID=135801',
          name: "Hospice Care Week",
          caption: "I took the 'Count me in!' pledge for Hospice Care Week",
          description: "Take the ‘Count me in!’ pledge and spread the word about why hospice care counts."
        };

        function callback(response) {
          document.getElementById("msg").innerHTML = "Post ID: " + response["post_id"];
        }

        FB.ui(obj, callback);
      }
 //]]>   
    </script>

1 个答案:

答案 0 :(得分:0)

我们目前遇到同样的问题。不知道你从哪里得到1500x1500的推荐尺寸。 docs

  

此帖子附带的图片的网址。图片必须至少50px乘50px(尽管图像大于200px乘200px是首选)并且最大宽高比为3:1

我们尝试过90x90和200x200,iPhone应用程序仍会裁剪它。其他地方的工作正常。