title: You must initialize FacebookUtils before calling logIn
body: <p>I have attempted to integrate Facebook with Parse. I have followed the following guide, <a href="https://parse.com/docs/js_guide#fbusers" rel="noreferrer">https://parse.com/docs/js_guide#fbusers</a> but is still experiencing issues.</p>
  
  <p>In a nutshell, there is a login button with facebook. When the user is non-existant it redirect the user to the signup page, and when its an existing user it redirects them to the city page of their selection in the account creation page. If user cancels the signup process, upon login, it takes the existing user to the account signup page.</p>
  
  <p>However, the facebook screen only appears when the user is non existant and haven't finalize the signup process. Below are the warnings I get when attempting to login:</p>
  
  <p><strong>On Console Warnings/Errors</strong></p>
  
  <ul>
  <li><p>The 'status' flag passed into FB.init, when set to true, can
  interfere with Parse Facebook integration, so it has been suppressed.
  Please call FB.getLoginStatus() explicitly if you require this
  behavior.</p></li>
  <li><p>FB.init has already been called - this could indicate a problem
     sdk.js:61 Setting authResponse is not supported</p></li>
  <li>You must initialize FacebookUtils before calling logIn.</li>
  <li>FB.login() called when user is already connected.</li>
  </ul>
  
  <p>Below is the Javascript code:</p>
  
  <pre><code>  // Initialize Parse
  Parse.initialize("ID", "ID");
  
    window.fbAsyncInit = function() {
      Parse.FacebookUtils.init({ // this line replaces FB.init({
        appId      : '433936150095453', // Facebook App ID
        status     : true,  // check Facebook Login status
        cookie     : true, 
        xfbml      : true,  // initialize Facebook social plugins on the page
        version    : 'v2.2' // point to the latest Facebook Graph API version
      });
  
      // Run code after the Facebook SDK is loaded.
    };
  
    (function(d, s, id){
      var js, fjs = d.getElementsByTagName(s)[0];
      if (d.getElementById(id)) {return;}
      js = d.createElement(s); js.id = id;
      js.src = "//connect.facebook.net/en_US/sdk.js";
      fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));
  
      function fbLogin(){
      Parse.FacebookUtils.logIn(null, {
    success: function(user) {
      if (!user.existed()) {
                  window.open("accountCreate.html", "_self");
      } else {
       if (city == "San Francisco") {
                  window.open("neighbourhoodselectSF.html", "_self");
                  } else if (city == "New York City"){
                  window.open("neighbourhoodSelectNYC.html",  "_self");
      }
              else {
  
                                window.open("accountCreate.html", "_self");
  
              }
  
      }
    },
    error: function(user, error) {
      alert("User cancelled the Facebook login or did not fully authorize.");
    }
  });
      }
  </code></pre>
  
  <p><strong>The html code:</strong></p>
  
  <pre><code>  &lt;button onclick="fbLogin()" id="facebookLogin" class="button button-block button-positive"&gt;
           &lt;i class="icon ion-social-facebook"&gt;&lt;/i&gt; &amp;nbsp; &lt;text id="textBtn"&gt;Get started with facebook &lt;/text&gt;
  &lt;/button&gt;
  
      &lt;script src="js/facebook.js"&gt;&lt;/script&gt;
  </code></pre>
  
  
  
  <pre><code>    &lt;script src="lib/facebookConnectPlugin.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>Any help would be greatly appreciated.</p>