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?


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.


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>

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!

链接地址: http://www.djcxy.com/p/53346.html

上一篇: 邀请用户通过Facebook在我的网站注册

下一篇: facebook sdk邀请朋友来申请