当我使用Facebook JS SDK的FB.ui调用发送对话框时,回调不会触发。
FB.ui(
{
method: 'send',
to: ****, // fbId
redirect_uri: *****, // public URL in my app domain
link: ***** // public URL
},
function(response) {
alert('callback was called!');
if (response != null) {
console.log('Request was passed along!');
location.href= ***; // just in case redirect_uri doesn't work
return true;
}
else {
console.log('Not passed along. User clicked cancel');
}
}
预期行为:应该显示警报。控制台消息应该被记录下来。用户应该被发送到重定向URI。
实际行为:这三件事情都没有发生。发送对话框打开,to:字段正确地预填。当我点击发送时,它会被正确发送。但我需要触发回调并将用户发送到redirect_uri。