Reputation: 1618
I need to pass additional parameter to redirect url when the user accept fb app request or need to redirect user to a custom url. How can I do this?...Please see the following code.
$('#sendRequest').click(function() {
FB.ui(
{
method : 'apprequests',
message : $(this).attr('data-message')
},
function (response) {
// If response is null the user canceled the dialog
if (response != null) {
logResponse(response);
}
}
);
});
Upvotes: 0
Views: 948
Reputation: 1618
I have used "data" parameter to send information while sending the request and accessed it in the other end using the "request id".
$('#sendRequest').click(function() {
FB.ui(
{
method : 'apprequests',
message : $(this).attr('data-message'),
data: sessionId,
max_recipients:1
},
function (response) {
// If response is null the user canceled the dialog
if (response != null) {
logResponse(response);
}
}
);
});
Upvotes: 1
Reputation: 96413
There is nothing that you can add in the code you’ve shown.
If you need to combine any data with a request, than you’ll have to save this data to your own database, so you can look it up again when receiving the request id(s) send to you when a user accepts requests.
Upvotes: 0