I'm trying to execute callback function in FB.ui (send dialog). It called in same moment when loaded FB.ui but I want execute callback function after pressing 'send' or 'cancel' button. Is it realizable?
function callback(response) {
alert('message was sent');
}
FB.ui({
method: 'send',
name: 'Dialog',
link: 'http://***.com',
redirect_uri: '****',
description: '***',
picture: '***',
to: userId
},
callback(response)
);