当我尝试使用JS FB.api([...]
执行操作时,我得到No callback passed to the ApiClient [...]
我在哪里可以设置此回调?
答案 0 :(得分:5)
只需在API调用中添加回调函数:
FB.api(
'/me/[YOUR_APP_NAMESPACE]:[YOUR_ACTION]',
'post',
{ recipe: '[LINK_TO_YOUR_OBJECT]' },
function(response) {
if (!response || response.error) {
alert('Error occured');
}
else {
alert('Action was successful! Action ID: ' + response.id)
}
}
);