i’m using this code to invite friends in my facebook application
$app_id = "000000000000000000000";
$canvas_page = "http://apps.facebook.com/applicationname/";
$message = "join me in this app.";
$requests_url = "https://www.facebook.com/dialog/apprequests?app_id="
. $app_id . "&redirect_uri=" . urlencode($canvas_page)
. "&message=" . $message;
if (empty($_REQUEST["request_ids"])) {
echo("<script> top.location.href='" . $requests_url . "'</script>");
every time the user call this page he can see all his friends
i need to view only the UNinvited friends.
how?
A better method would be to use the javascript SDK. You can use that to render a facebook popup with the share dialog inside…
With regard to your question, you can use filters for the
apprequestmethod as stated here. You are looking for theapp_non_usersfilter.[EDIT]
If you want to filter even more – ie. don’t list friends that have already been invited (but not yet accepted), you’ll have to read each
request_idgenerated and store the invited users facebook UID and place them in theexclude_idsfilter. This method could be further optimized by using the javascript sdk andFB.ui()method, posting the generatedrequest_idsusing AJAX, reading therequest_idserver-side and returning the users UID to be added to a javascript array in order to be used in theexclude_idsfilter for subsequentFB.ui()invite calls…