gpt4 book ai didi

ios - Facebook 分享图片和 Applinks

转载 作者:行者123 更新时间:2023-11-29 00:46:56 77 4
gpt4 key购买 nike

我停留在 Facebook 分享上..

我想要的只是发布来 self 的 iOS 应用程序的图像,其中包含文本和应用程序链接,可以将用户重定向到已安装的应用程序或 App Store。

应用程序链接工作正常,我描述了一些像这样的元标记:

    <meta property="al:ios:url" content="cubeDev://" />
<meta property="al:ios:app_store_id" content="1054030..." />
<meta property="al:ios:app_name" content="My app name" />
<meta property="al:web:should_fallback" content="false" />
<meta property="og:image:width" content="50" />
<meta property="og:image:height" content="50" />
<meta property="og:image" content="https://spb.hh.ru/employer-logo/1625583.png" />
<meta property="og:type" content="website" />
<meta property="og:title" contetn="title" />
<meta property="og:description" content="App description.." />
<meta property="fb:app_id" content="31667067867..." />

分享代码也很简单:

 FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init];
content.contentURL = [NSURL URLWithString:@"http://176.31.132.151:8000/"];
content.imageURL = [feedCell imageURL];
content.quote = [feedCell text];

FBSDKShareDialog *shareDialog = [[FBSDKShareDialog alloc] init];
shareDialog.mode = FBSDKShareDialogModeNative;
if(!shareDialog.canShow) {
shareDialog.mode = FBSDKShareDialogModeFeedBrowser;
}
shareDialog.fromViewController = self;
shareDialog.shareContent = content;
shareDialog.delegate = self;
[shareDialog show];

在哪里http://176.31.132.151:8000/是我的应用程序链接。

似乎当您在应用程序链接的元标记中描述图像时,图像 url 属性将不起作用..

所以,我的目标是发布来自应用程序的图像以及文本,并在下面发布应用程序链接以及我的应用程序图标和说明。

将不胜感激。

最佳答案

访问后Facebook bugs page

我发现 Facebook 团队成员之一对此行为的解释,似乎当前的 fb sdk 无法做到这一点,唯一的解决方案是创建一个带有动态参数的应用程序链接页面..没有我预期的那么好。

Roemer Vlasveld · · Facebook Team Hi Deepak,

...

It turns out that this behaviour is by design. In the past, the experience with sharing both a photo and a link caused a mixed experience. Currently, when sharing both a photo and a link, only the link will be used to create a preview.

The workaround would be to add the photo as an Open Graph image to the link that will be shared. This might require that each link is unique, but that will ensure that the preview created (at least in the created post) uses the image from the provided link.

I will mark this bug as 'By Design', since it reflects intended behavior. If you still encounter problems with this, feel free to reopen by leaving a new comment or reply.

Roemer

关于ios - Facebook 分享图片和 Applinks,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38525095/

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