I'm totally new in Facebook API. I have created a Facebook app and through a java web app I want to send requests to invite my friends to use my app and redirect them to the app download page (or at the moment to any webpage, eg. www.google.com).
I've followed these steps: https://developers.facebook.com/docs/reference/dialogs/requests/
But I don't know if this is what I'm looking for. Please any help would be great !
The code I wrote is:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html">
<h:head>
<title>Facelet Title</title>
</h:head>
<h:body>
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<p>
<input type="button"
onclick="sendRequestToRecipients(); return false;"
value="Send Request to Users Directly"
/>
<input type="text" value="User ID" name="user_ids" />
</p>
<p>
<input type="button"
onclick="sendRequestViaMultiFriendSelector(); return false;"
value="Send Request to Many Users with MFS"
/>
</p>
<script>
FB.init({
appId: '151779115008427',
frictionlessRequests: true
});
function sendRequestToRecipients() {
var user_ids = document.getElementsByName("user_ids")[0].value;
FB.ui({method: 'apprequests',
redirect_uri: 'http://www.google.com',
message: 'My Great Request',
to: user_ids
}, requestCallback);
}
function sendRequestViaMultiFriendSelector() {
FB.ui({method: 'apprequests',
message: 'My Great Request'
}, requestCallback);
}
function requestCallback(response) {
// Handle callback here
}
</script>
</h:body>
I get the next error: