The initialization code:
FB.init({
appId: \'123456789012345\',
channelUrl: \'http://localhost/Some/Url/FacebookCh
I have the same problem and have never been able to get a response from Facebook for the callback function. I don't see anything in console.log or any alerts I insert in the function.
My solution was to put a URL in FB.ui's redirect_uri that goes to an HTML page with self.close (or window.close). The FB.ui popup redirects there after the user's input and immediately closes. Remember to change your FB app's Site URL setting so it matches the domain the file resides on.
Here's my code, tied to my form's submit action. The function(response) callback is still there but not used. If anyone sees a syntax error please 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');
}
});
The line of code in self.close.html: