private function InviteMyFriends(e:MouseEvent):void{
var dat:Object = new Object();
dat.message = "Let's invite friends for our Super Krish QuizGame Facebook App to get bonus points";
dat.title = 'Super Krish QuizGame Facebook App';
// filtering for non app users only
dat.filters = ['app_non_users'];
//You can use these two options for diasplaying friends invitation window 'iframe' 'popup'
Facebook.ui('apprequests', dat, onUICallback, 'popup');
}
private function onUICallback(dat):void{
var result:Object = dat;
if(result == null){
mtline.trace2_txt.text = "User closed the pop up window without inviting any friends";
return
}
var invitedUsers:Array = new Array();
invitedUsers = result.request_ids as Array;
mtline.trace2_txt.text ="You Have Invited " + invitedUsers.length+ " friends";
//Simple if else if you want user to invite certain amount of friends
if(invitedUsers.length > 1){
mtline.trace2_txt.text = "GREAT, USER IS GENERATING TRAFFIC";
}else{
mtline.trace2_txt.text = "No Good, User invited only one friend ";
}
}
嗨,在这里,我使用此代码将我的Facebook游戏邀请发送给我的朋友使用Facebook api与动作脚本。工作完美但我需要确定我的朋友接受我的邀请,因为我必须提供500点给在邀请被接受后将邀请发送给他的朋友的用户。对此有所帮助。
提前致谢
答案 0 :(得分:1)
您提议的工作流程明确违反Facebook政策,您的应用可能会因此失去发送请求的能力,请在进一步操作之前先了解这一点。
至于如何跟踪已接受的请求,您必须在用户点击“接受”时读取和删除请求,因此您应该在发送时记录请求ID并在处理时更新记录接受的请求