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

using services/ParseServices.js (with Parse-Angular-Patch) causes repeated calls to FB.init() #30

Open
rbutera opened this issue Aug 3, 2014 · 3 comments

Comments

@rbutera
Copy link

rbutera commented Aug 3, 2014

My console is littered with error statements (particularly when running tests) with the following:
FB.init has already been called - this could indicate a problem

so far I have yet to encounter where this is problematic.

For reference, I have included the following files in my index.html:
parse-angular-patch/dist/parse-angular.js
parse-angular-demo/services/ParseServices.js
parse-angular-demo/services/FacebookAngularPatch.js

and I have the following async sdk code there too:

    <script type="text/javascript">
      (function(doc, script) {
        var js,
            fjs = doc.getElementsByTagName(script)[0],
            add = function(url, id) {
                if (doc.getElementById(id)) {return;}
                js = doc.createElement(script);
                js.src = url;
                id && (js.id = id);
                fjs.parentNode.insertBefore(js, fjs);
            };
        // Facebook SDK
        add('//connect.facebook.net/en_US/all.js', 'facebook-jssdk');
      }(document, 'script'));
    </script>

    <!-- Async resolve promise when FB SDK is loaded, this triggers Parse.FacebookUtils.init() -->
    <script>
      var fbDeferred = $.Deferred();
      window.fbPromise = fbDeferred.promise();
      window.fbAsyncInit = function() {
        fbDeferred.resolve();
      };
    </script>

    <script type="text/javascript">
      // manual bootstrap
      angular.element(document).ready(function() {
        angular.bootstrap(document, ['cloakroomApp']);
      });

    </script>

What can I do to remove this error?

@cjosepha
Copy link

cjosepha commented Dec 2, 2014

I have the same problem and look for a solution. Did you find a solution ?

@datomnurdin
Copy link

No solution?

@mohamedazouz
Copy link

+1

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

4 participants