想要在来自 Flash 应用程序的 facebook 共享链接中自定义标题/图像/描述 [英] Want custom title / image / description in facebook share link from a flash app

查看:12
本文介绍了想要在来自 Flash 应用程序的 facebook 共享链接中自定义标题/图像/描述的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<块引用>

可能的重复:
Facebook Sharer 如何选择图片?

我正在制作一个 Flash 应用程序,用于演示以不同速度行驶时潜在的交通伤害.我希望用户能够在 facebook 上分享这些信息.但是,这要求我可以以某种方式自定义将出现在 facebook 上的文本.

我正在制作一个在空白窗口中打开的网址(来自 Flash 应用程序本身).我指定了 u 和 t 参数,将生成的消息作为 t 参数.但这似乎总是被页面标题所覆盖.如果我从 html 代码中省略了标题标签,则使用文件名(也覆盖指定的标题).

<前>http://www.facebook.com/sharer.php?u=http://espentokerud.com/face/addiste.html&t=test;

我也尝试过对网址进行网址编码,但无济于事.

<前>http://www.facebook.com/sharer.php?u=http%3a%2f%2fespentokerud.com%2fface%2faddiste.html&t=test;

我也尝试过使用 addthis API,但遇到了同样的缺点.有趣的是,如果我发布一个swf,标题和描述可以自定义,也可以指定截图.但如果我不发布 swf,这似乎被忽略了.

我知道我可以在 html 页面上使用元标记来指定缩略图、标题和描述,但其中一些内容必须基于 Flash 应用程序内部的计算.

解决方案

2016 更新

使用分享调试器找出您的问题所在.

确保您遵循 Facebook 分享最佳做法.>

确保您正确使用开放图谱标记.

原答案

我同意这里已经说过的内容,但是根据 Facebook 开发者网站上的文档,您可能需要使用以下元标记.

<meta property="og:description" content="description"/><meta property="og:image" content="thumbnail_image"/>

如果您无法使用元标记实现目标,并且需要嵌入 URL 的版本,请参阅@Lelis718 的下面的答案.

Possible Duplicate:
How does Facebook Sharer select Images?

I am making a flash app that demonstrates potensial traffic injuries when driving at different speeds. I want the user to be able to share this information on facebook. However this demands that i can customize the text that will appear on facebook in some manner.

I am making an url that is opened in a blank window (from the flash app itself). I specify the u and t parameters, putting the generated message as the t parameter. But this seems to always be overridden by the pages title. If i omit the title tag from the html code, the file name is used (also overriding the specified title).

http://www.facebook.com/sharer.php?u=http://espentokerud.com/face/addiste.html&t=test;

I also tried url-encoding the url, but to no avail.

http://www.facebook.com/sharer.php?u=http%3a%2f%2fespentokerud.com%2fface%2faddiste.html&t=test;

I also tried using the addthis API, but experience the same shortcomings. The funny thing is that if i post a swf, the title and description can be customized, and it is also possible to specify a screenshot. But if i dont post a swf, this seems to be ignored.

I am aware that I can use meta tags on the html page to specify the thumbnail image, title and description, but some of this content has to be based on calculations inside the flash app.

解决方案

2016 Update

Use the Sharing Debugger to figure out what your problems are.

Make sure you're following the Facebook Sharing Best Practices.

Make sure you're using the Open Graph Markup correctly.

Original Answer

I agree with what has already been said here, but per documentation on the Facebook developer site, you might want to use the following meta tags.

<meta property="og:title" content="title" />
<meta property="og:description" content="description" />
<meta property="og:image" content="thumbnail_image" />

If you are not able to accomplish your goal with meta tags and you need a URL embedded version, see @Lelis718's answer below.

这篇关于想要在来自 Flash 应用程序的 facebook 共享链接中自定义标题/图像/描述的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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