Facebook与图像和应用程序共享 [英] Facebook Sharing with image and Applinks

查看:183
本文介绍了Facebook与图像和应用程序共享的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



所有我想要的是从我的iOS应用程序发布图像,文本和应用程序,可以将用户重定向到应用程序或App Store。



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

 < meta property =al:ios:urlcontent =cubeDev:///> 
< meta property =al:ios:app_store_idcontent =1054030 .../>
< meta property =al:ios:app_namecontent =我的应用程序名称/>
< meta property =al:web:should_fallbackcontent =false/>
< meta property =og:image:widthcontent =50/>
< meta property =og:image:heightcontent =50/>
< meta property =og:imagecontent =https://spb.hh.ru/employer-logo/1625583.png/>
< meta property =og:typecontent =website/>
< meta property =og:titlecontetn =title/>
< meta property =og:descriptioncontent =App description ../>
< meta property =fb:app_idcontent =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/ 是我的应用程序链接。



似乎当您在应用程序链接的元标记中描述图像时,图像网址属性将无法正常工作。



所以,我的目标是通过文字发布应用程序的图片,以及下面的应用程序链接和我的应用程序图标和描述。



请感谢任何帮助。

解决方案

Facebook错误页面



我发现一个Facebook团队成员对此行为的解释,似乎没有办法使用当前的fb sdk,
唯一的解决方案是创建一个具有动态参数的应用程序链接页面。不是那么好如我所料。


Roemer Vlasveld··Facebook团队Hi Deepak,



...



事实证明,这种行为是设计的。过去,分享照片和链接的
体验导致混合的
体验。目前,当分享照片和链接时,只会使用
链接来创建预览。



解决方法是将照片添加为打开图形图像到
链接将被共享。这可能需要每个链接是唯一的,
,但这将确保创建的预览(至少在创建的
文章中)使用提供的链接中的图像。



我将这个错误标记为按设计,因为它反映了预期的
行为。如果你仍然遇到这样的问题,可以通过留下新的评论或回复来重新开启



Roemer


< blockquote>

I stuck on the Facebook sharing..

All I want is to post an image from my iOS app, with text and applink, that can redirect users to installed app or App Store.

App link works fine, I described some metatags like this:

    <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..." />  

Share code also pretty simple:

 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]; 

Where http://176.31.132.151:8000/ is my app link.

It seems like when you describe an image in meta tags for app link, image url property won't work..

So, my goal is to post an image from app with text, and app link below with my app icon and description..

Will be grateful for any help.

解决方案

After visiting Facebook bugs page

I found an explanation of this behavior by one of Facebook team's member and it seems like that there is no way to do that with current fb sdk, the only solution is to create an app link page with dynamically parameters.. not so good as I expected.

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

这篇关于Facebook与图像和应用程序共享的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆