I am trying to create an app request using the Facebook C# SDK but it doesn't seem to work. Here is my code:
var fb = new FacebookClient(accessToken);
dynamic parameters = new ExpandoObject();
parameters.message = "Hello World!";
parameters.data = "Custom Data Here";
dynamic result = fb.Post("me/apprequests", parameters);
var id = result.id;
If I understand well it should show me a dialog box displaying a list of friends from which I can select but instead I don't see anything.
Would somebody also know how to get the list of facebook ids after the post has succes开发者_Python百科sfully occurred?
Thank you.
Jon
Here is source code for what you are trying to do, this is plain JavaScript SDK.
call following JavaScript function on your button click or similar:
function InviteFriends(){
var ResponseIds = FB.ui({
method : 'apprequests',
message: 'Your personal message herer',
},
function(ResponseIds ) {
console.log("IDS : " + ResponseIds.request_ids);
}
);}
Make sure you have following code in body tag $
<div id="fb-root"> </div>
<script type="text/javascript" src="http://connect.facebook.net/en_GB/all.js"></script>
<div class="footer">
<br />
<script type="text/javascript">
FB.init({
appId: 'YOUR_APPID_HERE', //read your appid dynamically from codebehind C#
status: true, // check login status
cookie: true, // enable cookies to allow the server to access the session
xfbml: true // parse XFBML
});
</script>
</div>
精彩评论