2011-05-18 71 views
0

我試圖創建測試用戶(作品),然後邀請他們到我的應用程序,以便測試我是否可以檢索跟蹤數據(在數據字段內)。不幸的是,當我邀請發送給測試用戶我得到一個異常:Facebook API:我可以邀請測試用戶加入我的應用程序嗎?

API錯誤代碼:2

API錯誤說明:服務 暫時不可用

錯誤信息:服務暫時 不可用

這裏是我的代碼:

<input type="text" value="@ViewBag.TestId" id="theId" /> 

<div id="fb-root"></div> 
<script type="text/javascript"> 
    window.fbAsyncInit = function() { 
     FB.init({ 
      appId : '193005690721590', 
      status : true, 
      cookie : true, 
      xfbml : true 
     }); 
    }; 
    console.log(@ViewBag.TestId); 
    $('#sendReq').click(sendRequest); 
    function sendRequest() { 
     FB.ui({ 
      method: 'apprequests', 
      message: 'Invitation to the test application!', 
      title: 'Send your friends an application request', 
      to: $('#theId').val(), 
      data: 'someCode' 
     }, 
     function (response) { 
      if (response && response.request_ids) { 
       var requests = response.request_ids.join(','); 
       $.ajax({ 
        url: '/Home/Parse', 
        type: 'post', 
        data: response, 
        success: function (data) { 
         if (data.result === 'ok') { 
          alert("Everything went fine"); 
          //top.location.href = '/Home/About'; 
         } 
        } 
       }); 
      } else { 
       alert('canceled'); 
      } 
     }); 
     return false; 
    } 

    (function() { 
    var e = document.createElement('script'); 
    e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js'; 
    e.async = true; 
    document.getElementById('fb-root').appendChild(e); 
}()); 
</script> 

我的代碼得到了測試用戶的正確ID,然後我試圖發送邀請但沒有成功...

有什麼想法?

+0

您是否從另一個測試帳戶發送請求? – 2011-05-18 08:27:03

+0

@echeese:不,我從我自己的帳戶發送它。 – Kassem 2011-05-18 08:28:08

+0

這可能是你的問題。測試用戶和普通用戶完全相互關閉。 – 2011-05-18 08:32:11

回答

1

我認爲你的問題可能是由於你試圖從你自己的帳戶邀請測試用戶。在Test Users文檔中列出的其中一個侷限性是「測試用戶只能與其他測試用戶進行交互,而不能與現場的真實用戶進行交互。」

+0

你說得對。我現在正在手動做所有事情,它對我很有用。我仍然面臨最後一個問題,這裏解釋:http://stackoverflow.com/questions/6043025/facebook-c-sdk-traverse-the-jsonarray-to-get-the-value-of-tracking-data – Kassem 2011-05-18 10:16:34

相關問題