我正在使用 forge facebook api 打开提要对话框以将图像发布到用户墙上。如果用户单击“取消”而不是“共享”,则仍会触发成功回调。如果用户单击关闭 ( x ) 按钮,错误回调将正确触发。
forge.facebook.ui(
{
method: 'feed',
link: link,
picture: model.get('file').url,
name: name,
caption: caption,
description: 'Lorem Ipsum'
},
function(response) {
// Called when user clicks cancel.
forge.notification.create(
'Great!',
'Item has been posted to your wall',
function() {
},
function(error) {
forge.logging.error(JSON.stringify(error));
}
);
},
function (e) {
// Called when user closes dialogue but not on cancel.
forge.logging.info('facebook failed: ' + JSON.stringify(e));
}
);