Facebook 分享链接 - 您可以自定义消息正文吗? [英] Facebook share link - can you customize the message body text?

查看:24
本文介绍了Facebook 分享链接 - 您可以自定义消息正文吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个链接,用于在 Facebook 上分享页面.到目前为止,我有:

href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.cnn.com%2F&t=CNN%26s+网站"

但是,我真的很想添加一些文本,这些文本将出现在'你有什么想法?' 文本框中(尤其是当 t 值被覆盖时通过链接的标题).有谁知道这是否可能?

解决方案

不能使用 sharer.php 执行此操作,但是您可以使用对话 API.中.字段 picturenamecaptiondescription 现在已弃用.

因此,为了共享到墙上,您最好使用 sharer.php,它不需要需要 app_id>,因此不需要注册应用程序:

http://www.facebook.com/sharer.php?u=https://example.com

I'm trying to create a link that will share a page on Facebook. So far I've got:

href="http://www.facebook.com/sharer.php
?u=http%3A%2F%2Fwww.cnn.com%2F
&t=CNN%26s+website"

However, I'd really like to add some text that will go in the 'What's on your mind?' text box (especially as the t value gets overridden by the link's title). Does anyone know if this is possible?

解决方案

You can't do this using sharer.php, but you can do something similar using the Dialog API. http://developers.facebook.com/docs/reference/dialogs/

http://www.facebook.com/dialog/feed?  
app_id=123050457758183&  
link=http://developers.facebook.com/docs/reference/dialogs/&
picture=http://fbrell.com/f8.jpg&  
name=Facebook%20Dialogs&  
caption=Reference%20Documentation& 
description=Dialogs%20provide%20a%20simple,%20consistent%20interface%20for%20applications%20to%20interact%20with%20users.&
message=Facebook%20Dialogs%20are%20so%20easy!&
redirect_uri=http://www.example.com/response

The catch is you must create a dummy Facebook application just to have an app_id. Note that your Facebook application doesn't have to do ANYTHING at all. Just be sure that it is properly configured, and you should be all set.

November 2021 update

The feed part of the Dialog API no longer includes the message field in the message. It is not included in the feed dialog documentation. The fields picture, name, caption, and description are now deprecated.

Therefore, for the purpose of sharing to the wall, you're better off with sharer.php, which does not require an app_id, and therefore does not need registering an app:

http://www.facebook.com/sharer.php?u=https://example.com

这篇关于Facebook 分享链接 - 您可以自定义消息正文吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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