问题
I have a "friendpicker" on my app to send an apprequest. It features an option "Select All", so.. when I try to invite 560 friends it doesen't work. Their user ID's don't even fit in the URL.
So, is there any fixed limit for this feature?
I couldn't find any reference to it in the documentation (https://developers.facebook.com/docs/concepts/requests/)
回答1:
Facebook limit is 50, Internet Explorer limitation only supports up to 25 requests at one time
A user ID or username, or a comma-separated list of them. These may or may not be a friend of the sender. If this is specified by the app, the sender will not have a choice of recipients. If not, the sender will see a multi-friend selector and will be able to select a maximum of 50 recipients. (Due to URL length restrictions, the maximum number of recipients is 25 in IE7/IE8 when using a non-iframe dialog.)
https://developers.facebook.com/docs/reference/dialogs/requests/
To simplify the process trigger the process of suggesting the invite right after page load, and don't fill in the "to"... this will open up a facebook dialog that allows facebook to handle the ui and processing of the request.
Example shown below
<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"> </script>
<script type="text/javascript">
FB.init({
appId:'<? echo $appID; ?>', cookie:true,
status:true, xfbml:true
});
function send_invitation(){
FB.ui({
method: 'apprequests',
message: 'ReeMatch analyzes your resume to find you jobs and compare them to bring you relevant jobs instantly. - www.ReeMatch.com',
redirect_uri: 'http://reematch.com/',
max_recipients: 25,
title: "Invite your friends to ReeMatch.com"
});
}
function fb_logout(){
FB.logout(function(response) {
parent.location ='<? echo $base_url; ?>';
});
}
setTimeout(function () {
send_invitation();
}, 1000);
</script>
FYI: We put a 1 second timer so when it triggers the send_invite call the browser doesn't block the call.
回答2:
At the bottom of that page you linked, there's a banner that says
New Facebook policy, effective July 10, 2013: App requests can no longer offer a select all option or pre-select multiple recipients to receive a request.
回答3:
In https://developers.facebook.com/docs/reference/dialogs/requests/ I found the following information regarding the to
parameter:
If not (set), the sender will see a multi-friend selector and will be able to select a maximum of 50 recipients.
So, I did a test populating to
with 51 and 50 friends. The first gave an explicit error (too much friends) and the second actually passed.
TL;DR
The limit is 50 friends.
来源:https://stackoverflow.com/questions/17574635/fb-apprequests-how-many-friends-can-i-invite-at-a-time