While searching the web, I found this code:
$apprequest_url ="https://graph.facebook.com/" .
"/apprequests?ids=USERID_1,USERID_2,USERID_3" .
"&message='INSERT_UT8_STRING_MSG'" .
"&data='INSERT_STRING_DATA'&" .
$app_access_token . "&method=post";
Can anyone explain to me how this sends an app request? And how is it supposed to work? Do you add it to a button?
The URL is a Graph API endpoint, along with necessary options via the query string.
It works by a request being made to that URL, and Facebook will return the result of that Graph API call via the HTTP response.
For more info, you should do a little research on REST APIs. 😉
As a side note as well, the code in ASHUTOSH’s response bring up a dialog from which to send app requests via the FB javascript SDK, but then behind the scenes the SDK is merely wrapping a call/response to the Graph API anyway. You can check it out using Firebug for FF, or the other browser dev tools in Chrome, IE, etc. Just go into the Network tab and see the HTTP request being made by the browser.