I have the same problem and I could never get a response from Facebook for the callback function. I do not see anything in console.log or any warnings that I insert in this function.
My solution was to put the URL in FB.ui redirect_uri, which is sent to the HTML page with self.close (or window.close). The FB.ui popup window is redirected there after user input and closes immediately. Remember to change the URL setting of your FB application to match the domain where the file is located.
Here, my code attached to my form represents an action. The function (response) callback is still present but not used. If someone sees a syntax error, comment on it.
FB.ui ({ method: 'feed', name: '', link: '', picture: '', caption: '', description: '', actions: {name:'',link:''}, redirect_uri: 'http://.../self.close.html' }, function(response) { console.log(response); if (response && response.post_id) { alert('yes'); self.close(); } else { alert('else yes'); } });
Line of code in self.close.html:
<script type="text/javascript">self.close();</script>
source share