我正在做这个facebook邀请(apprequest),但我需要计算用户发出的邀请数量,有人可以帮我吗?
下面的代码有效,但无论用户发送多少邀请,它都只计算 1 个邀请
<script>
FB.init({
appId:'<?=$myappid?>',
cookie:true,
status:true,
xfbml:true
});
function FacebookInviteFriends()
{//start of FacebookInviteFriends
var inviteCounter = FB.ui({
method: 'apprequests',
message: '<?=$me['name']?> has invited you to play this game!',
title: 'Select your friends to play this game!',
exclude_ids: <?=$allFBStr?>,
max_recipients: 5
},
function (inviteCounter) {
var userID = '<?=$me['id']?>';
//alert(userID);
$.ajax({//ajax
type: 'POST',
url: 'addInvitationCounter.php',
data: {
userID: userID
},
success: function(result){
//alert("SUCCESS: " + result);
location.href = "myprofile.php";
},
error: function(result){
alert("ERROR: " + result);
}
});
}
);
}
</script>