I need to personalise the caption part of the dialog in an FB Feed Dialog.
The caption
needs to read something like:
{*actor*} just entered his/her tip
...where his/her
should be the possessive pronoun for the logged in user.
I assumed that there would be a token I could use and FB would substitute it correct (à la the old <fb:pronoun possessive="true">
from FBML days), however I can't find any mention in the database.
My second thought was to get the user's profile data (I have an access token) and switch based on the gender
attribute, however this seems a bit long-winded.
If there's no quick and easy way, then I guess I'll just use "their"!
Thanks in advance.
This was my approach in the end:
var callback = function (profile)
{
switch(profile.gender)
{
case 'male':
pronoun = 'his';
break;
case 'female':
pronoun = 'her';
break;
default:
pronoun = 'their';
break;
}
params = {
method: 'feed',
name: name,
caption: "{*actor*} just entered "+pronoun+" top tip",
link: uri,
picture: picture,
description: description,
actions: [{
name: 'Enter your own',
link: uri
}],
ref: 'feed'
};
FB.ui(params);
};
FB.api('/me', callback);