node.js - in node js ,how to set login permission on facebook developer API? -
my code is:- .. , give me error in "output" ,how can solve it??
code:
var fb=require('fb'); fb.login(function(response) { // handle response if (response.status === 'connected') { console.log('logged in.'); } else { fb.login(); } }, {scope: 'publish_actions', return_scopes: true }); output: fb.login(function(response) { ^ typeerror: fb.login not function @ object.<anonymous> (c:\users\vvlocal\desktop\work\facebook\fblogin.js:3:4)
var options = {} var fb = require('fb'), fb = new fb.facebook(options); fb.login(function(response) { // handle response if (response.status === 'connected') { console.log('logged in.'); } else { fb.login(); } }, {scope: 'publish_actions', return_scopes: true });
try didn't test ;)
Comments
Post a Comment