I’m using the request dialog to send an application request to my friends.
Now, I want to embed my id, through a URL so when he clicks the invite, it has to
take him to my app and should get a link like this in the address bar in my browser: apps.facebook.com/test?uid=1111111111
This uid is my uid, because I sent the invite to my friend.
How to do this?
Updated on 21/10/2011
<script>
FB.init({
appId : 'YOUR_APP_ID',
status : true,
cookie : true,
oauth: true
});
function sendRequestToManyRecipients() {
FB.ui({method: 'apprequests',
message: 'My Great Request',
}, requestCallback);
}
function requestCallback(response) {
// Handle callback here
}
function getMultipleRequests(requestIds) {
FB.api('', {"ids": requestIds }, function(response) {
console.log(response);
});
}
</script>
In Request Dialog properties, there’s the property
datathat can be used to embed your unique identifier.When a user click the invitation notification, one (or more, if more than one friend invite hime)
request_idswill be returned. Then you can use the request_ids to querydata.UPDATE: to put
datain request:UPDATE2
The FB invitation has several steps:
1) This function open a dialog for user (for example, user A) to select friends to invite:
2) After user A invite a friend, says, user B. User B will get a notification on his news feed.
3) User B click into the notification, and get redirected to the canvas page: apps.facebook.com/test?request_ids=xxxxxx
4) You use the
request_idsto retrieve the invitation details, either by javascriptor by server code(php here, but the same mechanics for other languages):