我正在做這個facebook邀請(apprequest),但我需要統計用戶發出的邀請數量,任何人都可以幫助我?Facebook應用程序 - 我如何計算髮件人邀請的朋友數量?
以下作品中的代碼,但它只能算作一次邀請不管有多少邀請用戶發送
<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>
激勵用戶意味着在現實生活中還是在遊戲中?因爲對於他們在遊戲中所做的每一個邀請,玩家將能夠獲得5分 – Raynoro
它明確表示_「請求(包括邀請)」 - 在Ronny引用的內容中。並獎勵用戶發送邀請(邀請其他不使用應用的用戶/玩遊戲)會產生煩人的垃圾郵件 - 所以請不要這樣做。尋找其他方式來推廣你的遊戲。 – CBroe
Ronny和CBroe,感謝您的回覆,我將重新考慮爲我的項目實施其他功能:) – Raynoro