FB.login callback not called in javascript

I have a facebook app that is going to be installed on a facebook page. When an end user visits this app, he'll be asked to authorize the app. I'm using FB.login in JS to authorize and I do get facebook dialog asking for permission. But the control does not come to callback of FB.login at all. What am I missing here?

FB.init({
    appId: <app_id>
});
FB.login(function(response){
    console.log(response); //control never comes here even after user authorizing the app
}, {scope:"email,userlikes"});

Answers


You are adding a wrong permission here.

Replace userlikes with user_likes

(I dont think even the permissions were asked with your code since the permission is incorrect)

Check this Demo. When you close the login dialog, check the console of the browser, you'll see the response.


Need Your Help

Recognizing cx_Oracle install within PyDev

python windows anaconda pydev cx-oracle

I am on Windows 10 Pro 64-bit Anniversary Edition using Python 3.5.2 (Anaconda 4.1.1). I download the latest Oracle 12c Instant Client instantclient-basic-windows.x64-12.1.0.2.0.zip and instantclie...

How do I remove the characters?

excel vba excel-vba excel-formula

How do I remove special characters and alphabets in a string ?