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

Facebook.login() called before Facebook SDK has loaded. #136

Open
hliberato opened this issue Mar 2, 2017 · 4 comments
Open

Facebook.login() called before Facebook SDK has loaded. #136

hliberato opened this issue Mar 2, 2017 · 4 comments

Comments

@hliberato
Copy link

Hi guys! I am using the angular-facebook module since january, but today I am facing an error.

Facebook.login() called before Facebook SDK has loaded.

I use the login method with promisses, and this message return as an error.

I don't know what to do, because it was working like a charm.

angular.module('myApp')
  .config(function(FacebookProvider) {
   FacebookProvider.init('0000000');
  });

I always used like this. Anything changed?

@allanpoppe
Copy link

Hi @hliberato!

I'm also having this issue, and it started last week. Have you found a solution?

@hliberato
Copy link
Author

No, @allanpoppe :(

@allanpoppe
Copy link

@hliberato, search for line 589 on angular-facebook.js:

var src = '//connect.facebook.net/' + settings.locale + '/sdk.js'

Change it to:

var src = '//connect.facebook.net/' + settings.locale + '/all.js'

Also, I think we must change SDK version, because 2.0 will be deprecated as Facebook stated. I don't know if this is related to this bug. In any case, you might want to change line 221 to a newer Facebook SDK version.

@hliberato
Copy link
Author

hliberato commented Mar 3, 2017

Hey @allanpoppe, thanks!

The module is working again.

If anyone else want to use my fork with those updates, feel free :)

Bower way:
"dependencies": { "angular-facebook": "https://raw.githubusercontent.com/hliberato/angular-facebook/master/dist/angular-facebook.js" }

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

No branches or pull requests

2 participants