2011-04-10 6 views
0

내 앱에 Facebook request dialog을 사용하고 있습니다.내 사이트의 Facebook 대화 상자에서 반환 데이터에 액세스하려면 어떻게해야합니까?

FB.init({ 
    appId : 'app_id', 
    status : true, // check login status 
    cookie : true, // enable cookies to allow the server to access the session 
    xfbml : true // parse XFBML 
}); 

$('.facebook_request').live('click',function(){ 
    FB.ui({ 
     method: 'apprequests', 
     message: 'message', 
     to: 'user_id' 
    }); 
    return false; 
}); 

이것은 지금까지 작동합니다. 요청이 현재 페이지에서 팝업되고 올바르게 생성됩니다. 그러나 here과 같이 반환 데이터 (새로 생성 된 요청의 id)에 액세스하는 방법을 모르겠습니다. ID를 저장하기 위해 어떻게 액세스 할 수 있습니까?

답변

2

request_id 콜백에서 돌아 오면 :

FB.ui({ 
    method: 'apprequests', 
    message: 'message', 
    to: 'user_id' 
}, function(response) 
{ 
    for (i = 0; i < response.request_ids.length; i++) 
    { 
     alert(response.request_ids[i]); 
    } 
}); 
관련 문제