I'm using FB.ui
(.ui/) to create the "Post to Your Wall" feature on my website:
var new_post = {
method: 'feed',
link: '/path/to/my/site',
picture: '/path/to/image.jpg',
name: 'My Site',
caption: 'Lorem',
description: 'Ipsum',
message: 'Check out this link, guys!' //this does not work
};
FB.ui(new_post, callback_defined_somewhere);
How do I add a predefined message to the post, e.g. "Check out this link, guys!"
I've tried adding the message
parameter to the new_post
object, but that doesn't seem to work.
When the dialog is shown, focus is on the text box, with Say something about this...
instead of the Check out this link, guys!
message.
Any suggestions?
I'm using FB.ui
(https://developers.facebook./docs/reference/javascript/FB.ui/) to create the "Post to Your Wall" feature on my website:
var new_post = {
method: 'feed',
link: '/path/to/my/site',
picture: '/path/to/image.jpg',
name: 'My Site',
caption: 'Lorem',
description: 'Ipsum',
message: 'Check out this link, guys!' //this does not work
};
FB.ui(new_post, callback_defined_somewhere);
How do I add a predefined message to the post, e.g. "Check out this link, guys!"
I've tried adding the message
parameter to the new_post
object, but that doesn't seem to work.
When the dialog is shown, focus is on the text box, with Say something about this...
instead of the Check out this link, guys!
message.
Any suggestions?
Share Improve this question edited Apr 24, 2012 at 2:48 steveax 17.7k6 gold badges46 silver badges59 bronze badges asked Apr 24, 2012 at 2:11 ObayObay 3,20516 gold badges57 silver badges80 bronze badges2 Answers
Reset to default 7It has been removed from FB API since Jan 1st, 2012 and pletely removed after July 5th, 2012. see http://developers.facebook./docs/fbjs/
So nowadays you cannot specify the text of the message in any way.
You can use Open Graph Protocol.
Add this to your html tag: <html xmlns:og="http://opengraphprotocol/schema/">
And include this in your <head>
tag.
<meta property="og:title" content="Link title text!"/>
<meta property="og:type" content="website"/>
<meta property="og:url" content="http://example./"/>
<meta property="og:site_name" content="Link title text!"/>
<meta property="og:description" content="Link description text!"/>
<meta property="og:image" content="http://example./fbshare.png"/>
If you want multiple messages for the same url you can use ?something
and if isset($_GET['something'])
then change the og tags as you wish.