I'm currently messing around with the Facebook API. I created a Facebook app and everything. Then (with the help of XhacK) I managed to post to my wall and some of my friends' walls using the Facebook C# SDK. Then I found out that I cannot use the Request dialog using the C# SDK because facebook does not support that :/
So I had to use the Javascript API and I think things went okey... (I managed to send out invites). Here's what I got so far:
P.S: What I need to do eventually is to have the user invite their friends to the FB app which will then redirect them to the registration page on the website. Also, I need to pass some "invitation code" for tracking purposes (who actually invited that person?).
Any help would be really appreciated.
I'm totally new to this but I finally started to get the hang of it :)
So I had to use the Javascript API and I think things went okey... (I managed to send out invites). Here's what I got so far:
[URL=#]Send Application Request[/URL]
<div id="fb-root"></div>
<script type="text/javascript">
window.fbAsyncInit = function() {
FB.init({
appId : '193005690721590',
status : true,
cookie : true,
xfbml : true
});
};
$('a').click(sendRequest);
function sendRequest() {
FB.ui({
method: 'apprequests',
message: 'Invitation to the test application!',
title: 'Send your friends an application request',
},
function (response) {
if (response && response.request_ids) {
var requests = response.request_ids.join(',');
console.log(requests); //I got some large number... What is that exactly?
} else {
alert('canceled');
}
});
return false;
}
(function() {
var e = document.createElement('script');
e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
}());
</script>
But then when someone tries to accept the invitation, they end up getting a 404 - Unable to Connect error. Is that because I haven't submitted the app to facebook yet, or is there something wrong with my code?P.S: What I need to do eventually is to have the user invite their friends to the FB app which will then redirect them to the registration page on the website. Also, I need to pass some "invitation code" for tracking purposes (who actually invited that person?).
Any help would be really appreciated.
I'm totally new to this but I finally started to get the hang of it :)