user156888
user156888

Reputation:

facebook sdk invite friends to application

I want to allow users to invite friends to a facebook app through the Facebook c# sdk. I'm not keen on using the popups or any flakey meta language. is there a way to do this without resorting to popups?

Upvotes: 2

Views: 6169

Answers (3)

Roopchand
Roopchand

Reputation: 2728

invite facebook friend from your application or website,use this small lines of code and send invitation to all facebook friends to visit your website.i also used this script its working nicely. your domain must be ssl certified because facebook not allowing unsecured domains.

<script src="http://connect.facebook.net/en_US/all.js"></script>

<script>
FB.init({
appId:'APP_ID',
cookie:true,
status:true,
xfbml:true
});

function FacebookInviteFriends()
{
FB.ui({
method: 'apprequests',
message: 'Your Message diaolog'
});
}
</script>


//HTML Code
<div id="fb-root"></div>
<a href='#' onclick="FacebookInviteFriends();"> 
Facebook Invite Friends Link
</a>

Upvotes: 3

c0deslayer
c0deslayer

Reputation: 545

Using c# Facebook SDK on codeplex (facebooksdk.codeplex.com), you can send invitations to your friends by the following codes:

    var fb = new FacebookWebClient();
    dynamic parameters = new ExpandoObject();
    parameters.appId = "{yourAPPid}";
    parameters.message = "{yourmessage}";

    dynamic id = fb.Post("me/apprequests", parameters);

Best of Luck!

Upvotes: 2

Joey Schluchter
Joey Schluchter

Reputation: 2612

The best way to do this is via Requests 2.0. That is what FB recommends.

There is a blog post about it on Facebook Developers here: http://developers.facebook.com/blog/post/464/

It's actually quite simple:

FB.init({ 
  appId:'YOUR_APP_ID', cookie:true, 
  status:true, xfbml:true 
});

FB.ui({ method: 'apprequests', 
  message: 'Here is a new Requests dialog...'});

Behind the scenes, FB has made it a bit trickier to track the requests, but with the C# SDK it's just a graph call.

Upvotes: 2

Related Questions