我首先进入我的页面设置并取消选中“始终在您的页面上作为测试页面发表评论和发布,即使使用 Facebook 作为 X 时也是如此”。
我的代码如下:
// fb-id is usually POST_ID
FB.api($comments.data('fb-id') + '/comments', 'post', {
message: $('textarea', $comments).val(), // this works fine
from: FB.getUserID() // no effect
}, function(){
// callback here
});