Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Login Promise doesn't work #123

Open
joseluisq opened this issue Nov 30, 2015 · 6 comments
Open

Login Promise doesn't work #123

joseluisq opened this issue Nov 30, 2015 · 6 comments

Comments

@joseluisq
Copy link

I try this code and Promise is not resolved:

Facebook.login().then(function(){
  console.log('ok');
}, function(){
  console.log('error');
});

But, callback works instead:

Facebook.login(function(){
  console.log('ok');
  // > "ok"
});
@joseluisq joseluisq changed the title Promise support (enhancement) Login Promise doesn't work Nov 30, 2015
@maeishoj
Copy link

maeishoj commented Jan 5, 2016

anyone else? this is still not working!

@jamesfer
Copy link

Try passing in an empty function. I found that fixed my similar problem with getLoginStatus()
Eg:

Facebook.login(angular.noop).then(function() {
    ...
});

@humpedli
Copy link

humpedli commented Mar 6, 2016

And with your fix, how can you add parameters, like {scope: 'email'}?

@jamesfer
Copy link

jamesfer commented Mar 6, 2016

Ahh... I see...
I think login is the only function that takes the callback first instead of as the last param.
I'll just change the callback to be prepended to the array of arguments rather than appended.

@jamesfer
Copy link

jamesfer commented Mar 7, 2016

Just fixed it then.

@humpedli
Copy link

humpedli commented Mar 7, 2016

Oh great, thanks! Is there any way to merge this change to official repository? @Ciul

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants