2012-03-05 212 views
0
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與工作完美動作scripting.its我的朋友,但我需要找出我的朋友誰接受了我的邀請,因爲我必須向邀請被接受後向他的朋友發送邀請的用戶提供500點積分。請對此有所幫助。從Facebook好友誰接受了我的邀請請求

在此先感謝

回答

1

你提議的工作流程是明確反對Facebook的政策和您的應用程序可能會失去發送請求的結果,僅僅是知道的,你繼續進行之前,任何的能力。

至於如何跟蹤已接受的請求,當用戶點擊「接受」時,您已經必須讀取和刪除請求,因此您應該在發送時記錄請求ID並更新記錄處理已接受的請求