gpt4 book ai didi

ios - Facebook 的 iOS 应用程序 : sharing via feed dialogue using a ‘web app’ results in cropped image

转载 作者:行者123 更新时间:2023-12-01 16:49:20 24 4
gpt4 key购买 nike

我们正在使用基本的 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>

最佳答案

我们现在遇到了同样的问题。不确定您从哪里获得 1500x1500 作为推荐尺寸。 docs

The URL of a picture attached to this post. The picture must be at least 50px by 50px (though images larger than 200px by 200px are preferred) and have a maximum aspect ratio of 3:1

我们已经尝试了 90x90 和 200x200,但 iPhone 应用程序仍会对其进行裁剪。不过其他地方都工作正常。

关于ios - Facebook 的 iOS 应用程序 : sharing via feed dialogue using a ‘web app’ results in cropped image,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17469465/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com