I am working on a Facebook tap app. In the app the user selects an item page and in there he can write a comment about the item. After he has written his comment he clicks a button that opens up a facebook share dialog and the user comment is in the dialog box.
What I want to accomplish is inserting the comment to a database when the user clicks share and if he clicks cancel nothing happens.
Here is the function that I use to open up the dialog:
function FacebookPostToWall()
{
var comment = document.getElementById('comment').value;;
FB.ui({
method: 'feed',
link: 'http://linkfortheitem.com',
name: "Name of the item",
caption: "Caption for the item",
description: '' + comment,
picture: '',
message: ''
},
function(response){
if(response && response.post_id) {
alert('user has shared');
}else {
alert('user has not shared');
}
});
}
So my question is, is there a way to call my php function that inserts the comment to database inside the callback function?