luiscarlosjayk/angular-facebook

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

Opened this issue · 4 comments

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?

Hi @hliberato!

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

@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.

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" }