0
我試着把一些基於其他SO問題和各種網絡教程的代碼放在一起。Faceboook:使用多個朋友選擇器和JS SDK發佈到多個朋友的牆壁
我收到的錯誤是正確的,當我嘗試發佈到我朋友的牆上。
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<p><input type="button" onclick="sendRequestViaMultiFriendSelector(); return false;" value="Recommend friends for another chance to win!" /></p>
<div id="response"></div>
<script>
FB.init({
appId : 'xxxxxxxxxx',
status : true,
cookie : true,
oauth: true
});
function sendRequestViaMultiFriendSelector() {
FB.ui({method: 'apprequests',
message: 'My Great Request'
}, requestCallback);
}
function requestCallback(response) {
// Handle callback here
if (response.request && response.to) {
var request_ids = [];
for(i=0; i<response.to.length; i++) {
var temp = response.request + '_' + response.to[i];
var friend_id = response.to[i];
request_ids.push(temp);
//send message in here
var opts = {
message : 'Message',
name : 'Name',
link : 'http://www.facebook.com/pages/xxxxx/xxxxxxxxxxxxxxx',
description : 'Description here',
picture : 'http://www.domain.com/img/some.jpg'
};
FB.api('/'+friend_id+'/feed', 'post', opts, function(response) {
if (!response || response.error) {
// This is the error I am getting:
alert('Error occured');
} else {
alert('Post ID: ' + response.id);
}
});
// end send message
}
var requests = request_ids.join(',');
} else {
alert('Didn't send recommendation to friends');
}
}
</script>
有關如何解決此問題的任何想法?
如何賦予訪問.... ....? – 2013-05-31 12:41:17