I'm trying to get my mobile game to invite friends from facebook but I'm unable to. I'm using Facebook c# SDK for Windows 8 (hopefully porting when ready to WP8, Android and iOS) but the problem is I'm confused about the facebook API paremeters:
This is my code:
var fb = new FacebookClient (accessToken);
dynamic parameters = new ExpandoObject();
parameters.appId = facebookAppId;
parameters.message = "This is a test!";
parameters.to="friendID1,friendID2,...";
string request=String.Format ("/me/apprequests");
dynamic result = await fb.PostTaskAsync (request, parameters);
when I use this code, the Post task completes correctly, but (checking the result variable and looking at facebook) on the "me" user receives that invitation. The "to" field seems to be ignored and "me" is the only one receiving the request.
If I use
string request=String.Format ("/{0}/apprequests",FRIEND_ID);
instead of /me/apprequests, then I receive the following error:
OAuthException "(#2) Failed to create any app request",
I've read in some places that the access token must be an App Token, but the documentation says that it should only be used when your server is doing those requests, What I want is a user-to-user request, not an app-to-user request.
So far I've seen it's possible to get it in Android and iOS via a Dialog Request, but I've not found them in the C# SDK, so I'm trying to make the apprequest manually, without luck.
Is it possible to get this working with Windows Phone 8 or Windows 8? How?
Thanks, Kak