Title may not describe what I actually want, but I hope this is not a duplicate question as I couldn't find a relevant answer in my searches.
I'm developing a Facebook raid manager application for my own World of Warcraft guild and what I want it to do is:
Again, to be clear, I'm not trying to send application requests to non-application users. I just want a way to send requests to application users triggered by a user event.
Application already has a "Facebook Group" authorization, which means all app users are members of a specific facebook group (not a page).
Is this possible via Facebook dialogs?
Here is some rough code to send an app request using the C# SDK:
private string getAppAccessToken()
{
string facebookAppId = ConfigurationProvider.GetSetting("FacebookAppId");
string facebookAppSecret = ConfigurationProvider.GetSetting("FacebookAppSecret");
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(
String.Format("https://graph.facebook.com/oauth/access_token?grant_type=client_credentials&client_id={0}&client_secret={1}",
facebookAppId, facebookAppSecret));
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
var responseStream = new StreamReader(response.GetResponseStream());
var responseString = responseStream.ReadToEnd();
if (responseString.Contains("access_token="))
{
return responseString.Replace("access_token=", string.Empty);
}
return "";
}
private void postRequest(string id, string message)
{
FacebookClient app = new FacebookClient(this.getAppAccessToken());
dynamic parameters = new ExpandoObject();
parameters.message = message;
parameters.title = "Please use our app";
dynamic myId = app.Post(id + "/apprequests", parameters);
}
The notification should appear under App Center / Requests.
Hope this helps.