我试图创建测试用户(作品),然后邀请他们到我的应用程序,以便测试我是否可以检索跟踪数据(在数据字段内)。不幸的是,当我邀请发送给测试用户我得到一个异常: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,然后我试图发送邀请但没有成功...
有什么想法?
您是否从另一个测试帐户发送请求? – 2011-05-18 08:27:03
@echeese:不,我从我自己的帐户发送它。 – Kassem 2011-05-18 08:28:08
这可能是你的问题。测试用户和普通用户完全相互关闭。 – 2011-05-18 08:32:11