i am trying to implement a facebook request in a page tab application. i have seen the tutorial here http://developers.facebook.com/docs/appsonfacebook/tutorial/ but the problem is that i want the code below to be executed only when someone accesses a link like
<a href = "something">Send to friends</a>
any idea about how can this be done? thanks!
$requests_url = "http://www.facebook.com/dialog/apprequests?app_id="
. $app_id . "&redirect_uri=" . urlencode($the_url_of_the_tab_page)
. "&message=" . $message;
if (empty($_REQUEST["request_ids"])) {
echo("<script> top.location.href='" . $requests_url . "'</script>");
} else {
echo "Request Ids: ";
print_r($_REQUEST["request_ids"]);
}
The request dialog is what you are looking for:
So your "link" shouldn't be calling a real url but instead a Javascript function to open the Request Dialog (in the above example it'll be
sendRequestViaMultiFriendSelector()
).