2013-05-06 23 views
6

Tôi gặp sự cố với yêu cầu ứng dụng và bộ lọc ['app_non_users']. Mã số:Hộp thoại yêu cầu Facebook và bộ lọc "app_non_users" không hoạt động

window.fbAsyncInit = function() { 
    FB.init({appId: '123', status: true, cookie: true, xfbml: true}); 
    } 

    function sendRequestViaMultiFriendSelector() { 
    FB.ui({ 
     method: 'apprequests', 
     filters: ['app_non_users'], 
     message: 'Hello there!' 
    }, function callback(response) { 
     if (response) { 
      //do some stuff 
     } 
    }); 
    } 

Và như bạn có thể đoán, facebook hiển thị tất cả bạn bè (ngay cả những người đã sử dụng ứng dụng). Bất kì lời đề nghị nào?

Cảm ơn!

+0

Tôi đã gặp rắc rối tương tự một lần, để giải quyết nó, bạn có thể muốn thử sử dụng nhiều bộ lọc. Ý tôi là, sử dụng 'bộ lọc: ['app_non_users', 'tất cả']' –

+0

Không, vẫn như cũ;/ – User

+0

Ai cũng biết chuyện gì đang xảy ra? – User

Trả lời

0

sử dụng

function(response) { 
    // callback function 
} 

không

function callback(response) { 
    // callback function 
} 

hoặc như thế này ..

FB.ui({method: 'apprequests', 
title: app_title, 
message:inviteMsg, 
data:"invite" , 
filters: ['app_non_users'] 
}, inviteSent); 

function inviteSent(response){ 
    log(response);  
} 
+0

Gọi lại không ảnh hưởng đến các bộ lọc và 'app_non_users'. Vẫn giống nhau. – User

0

tôi đã tìm thấy rằng điều này làm việc cho tôi:

function sendRequest() { 
    FB.ui({ 
     method: 'apprequests', 
     message: 'Check out this application!', 
     title: 'Send your friends an application request', 
     filters: ['app_non_users'] 
    }, 
    function (response) { 
     console.log(response); 
     if (response.request && response.to) { 
     var request_ids = []; 
     for(i=0; i<response.to.length; i++) { 
      var temp = response.request + '_' + response.to[i]; 
      request_ids.push(temp); 
     } 
     var requests = request_ids.join(','); 
     $.post('<?=base_url()?>handle_requests',{uid: '<?php echo $user; ?>', request_ids: requests},function(resp) { 
      // callback after storing the requests 
     }); 
     } else { 
     alert('canceled'); 
     } 
    }); 
    return false; 
    } 
Các vấn đề liên quan