how to send invites to uninvited friends in facebook app?
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 apprequest
method as stated here. You are looking for the app_non_users
filter.
[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_id
generated and store the invited users facebook UID and place them in the exclude_ids
filter. This method could be further optimized by using the javascript sdk and FB.ui()
method, posting the generated request_ids
using AJAX, reading the request_id
server-side and returning the users UID to be added to a javascript array in order to be used in the exclude_ids
filter for subsequent FB.ui()
invite calls...
精彩评论