我们可以通过在对话框提要语法中提供“到”字段来发布给任何特定的朋友。
FB.init({appId: "", status: true, cookie: true});
function postToFeed() {
// calling the API ...
var obj = {
method: 'feed',
redirect_uri: [url],
link: 'https://developers.facebook.com/docs/reference/dialogs/',
picture: 'http://fbrell.com/f8.jpg',
name: 'Facebook Dialogs',
caption: 'Reference Documentation',
description: 'Using Dialogs to interact with users.',
to:[fb id]
};
function callback(response) {
document.getElementById('msg').innerHTML = "Post ID: " + response['post_id'];
}
FB.ui(obj, callback);
}
但我们如何设置一个文本框,允许用户选择要发布的朋友。或者有其他方法吗?