The following code is supposed to display a Facebook Request Dialog:
<script>
function sendFBRequest()
{
// assume we are already logged in
FB.init({appId: '111111111111111', xfbml: true, cookie: true});
FB.ui({
method: 'apprequest', // this needs to be plural!
message: 'Help me connect to Jane Doe',
data: 'game47',
title: 'Game Request'
},
function (response)
{
if (response && response.request_ids)
{
var requests = response.request_ids.join(',');
alert('requests = ' + requests);
}
else
{
alert('canceled');
}
});
}
</script>
<div class="awesome green" onClick="sendFBRequest();">Facebook Request</div>
When I click on the (awesome green) button, the basic dialog frame is displayed, and the dialog loading animation (flashing vertical grey bars) starts. But that’s it, no message is ever displayed. What am I missing?
Edit:
I used the method ‘apprequest’ instead of ‘apprequests’.
This works for me