Note that there are some explanatory texts on larger screens.

plurals
  1. POFacebook local development not working
    text
    copied!<p>I'm at my wit's end trying to get this to work. It used to, but for some reason seems like it's broken again. I'm only having trouble when developing locally. Is anyone else currently having similar issues with Facebook local development? </p> <p>These are my steps:</p> <ol> <li>Create an app</li> <li>Under the 'Basic Info' section, set 'localhost' as the domain (I have also tried leaving this blank)</li> <li>Set my website to <code>http://localhost:8080/</code></li> <li>Make sure sandbox mode is OFF</li> <li>My local server is running Javascript at <code>http://localhost:8080/private/</code> that looks basically like below.</li> <li>I have also tried using a substitute for localhost (like myapp.com), defining it in etc/hosts file mapped to 127.0.0.1, setting the App Domain to 'myapp.com' and using the site 'http://myapp.com:8080/' with no luck.</li> </ol> <p>FB.getLoginStatus() call is not returning, or only returns occasionally. It always works on the production server.</p> <pre><code> function myAppInit() { console.log("Facebook loaded; initializing sdk."); //Initialize FB SDK FB.init({ appId:_FbAppId, //This is valid and matches app ID cookie:true, status:true, xfbml:true, oauth:true }); //Query for login status. FB.getLoginStatus(function(response) { updateLoginStatus(response); //This is hit randomly }); //Set our standard callback for auth change status FB.Event.subscribe('auth.authResponseChange', function(response) { updateLoginStatus(response); //This is hit randomly }); } $(document).ready(function(){ window.fbAsyncInit = myAppInit; (function(d){ var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;} js = d.createElement('script'); js.id = id; js.async = true; js.src = "//connect.facebook.net/en_US/all.js"; d.getElementsByTagName('head')[0].appendChild(js); }(document)); } </code></pre> <p>EDIT: After checking the response for FB.getLoginStatus(..), it is returning this:</p> <blockquote> <p>Given URL is not allowed by the Application configuration: One or more of the given URLs is not allowed by the Application configuration. It must match one of the Connect or Canvas URLs or domain must be the same as or a subdomain of one of the Application's base domains.</p> </blockquote>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload