Reputation: 115
I am building a Facebook tab page and would like to have a link to contact a user (the tab page owner, myself) via a simple HTML link so that a user clicks the 'send a message' link and it opens a dialog with the recipient already attached to the message. This was instead of my previous solution of a basic mailto: anchor link but realised it would be much better to integrate this functionality inside Facebook.
I looked at the Facebook Send Dialog (http://developers.facebook.com/docs/reference/dialogs/send/) which seemed like the perfect solution. On further inspection it seems it is more geared up for sending/sharing links rather than just a simple message. I tried removing the link and name properties to simplify the functionality, but this created an error as it seems like it has to have a pre populated link?
There must be a really simple solution to this that someone can point out? Perhaps I am missing something quite obvious here!
Thanks Rich
Upvotes: 2
Views: 1662
Reputation: 4150
the send dialog is probally your best solution for this https://developers.facebook.com/docs/reference/dialogs/send/
from jssdk you could use feed dialog which can be set up to send to individual user, or pages you own. https://developers.facebook.com/docs/reference/javascript/ using the to parameter.
the below sample does require Javascript SDK - you can get here https://developers.facebook.com/docs/reference/javascript/
<javascript>
function feedthis() {
FB.ui({ method: 'feed',
message: '',
//caption: 'This is the Caption value.',
//name: 'Testing JS feed dialog on ShawnsSpace',
//link: 'http://shawnsspace.com?ref=link',
to: '391793380398',
//description: 'Testing property links, and action links via Feed Dialog Javascript SDK',
//picture: 'https://shawnsspace.com/ShawnsSpace.toon.nocolor..png',
//properties: [{ text: 'Link Test 1', href: 'http://shawnsspace.com?ref=1'},
//{ text: 'Link Test 2', href: 'http://shawnsspace.com?ref=2'},
//{ text: 'Link Test 3', href: 'http://shawnsspace.com?ref=3'},
//{ text: 'Link Test 4', href: 'http://shawnsspace.com?ref=4'}
//],
actions: [
{ name: 'Shawn', link: 'http://ShawnsSpace.com'}
]
});
};
</javascript>
Upvotes: 1