2011-05-18 69 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

相关问题