Facebook Login Error Using Parse Javascript SDK

I'm trying to log into Facebook via Parse in a PhoneGap project made for Android.

When I try to run the HTML locally, the pop-up will appear but I get the generic "an error occurred" message. When I run the Android project, the Facebook pop-up/redirect won't even appear.

    <script type="text/javascript" charset="utf-8" src="cordova-1.9.0.js"></script>
    <script src="http://www.parsecdn.com/js/parse-1.0.8.min.js"></script>
    <script>
        Parse.initialize("XXXXXXX", 
        "YYYYYY");

    </script>
</head>

<body>

    <div id="fb-root"></div>
    <script>
    window.fbAsyncInit = function() {
        Parse.FacebookUtils.init({
        appId      : 'ZZZZZZZ', // App ID
        channelUrl : '//WWW.YOUR_DOMAIN.COM/channel.html', // Channel File
        status     : true, // check login status
        cookie     : true, // enable cookies to allow the server to access the session
        xfbml      : true  // parse XFBML
    });

    // Additional initialization code here
    Parse.FacebookUtils.logIn(null, {
        success: function(user) {
            if (!user.existed()) {
            alert("User signed up and logged in through Facebook!");
        } else {
            alert("User logged in through Facebook!");
        }
    },
        error: function(user, error) {
            alert("User cancelled the Facebook login or did not fully authorize.");
        }
    });
};

  // Load the SDK Asynchronously
  (function(d){
     var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
     if (d.getElementById(id)) {return;}
     js = d.createElement('script'); js.id = id; js.async = true;
     js.src = "//connect.facebook.net/en_US/all.js";
     ref.parentNode.insertBefore(js, ref);
   }(document));
</script>

    <h1>Hello World</h1>
</body>

</html>

So, I'd love to get this working. Thanks in advance for any help! :)

Update - This is the error information I get:

API Error Code: 191 API Error Description: The specified URL is not owned by the application Error Message: Invalid redirect_uri: Given URL is not allowed by the Application configuration.

Answers


Did you ever find a complete solution for this? I can get around your specific problem by selecting Website with Facebook Login as how my app integrates with Facebook, and setting the website to [http://localhost]. which then works fine within Chrome running off a local server, but then doesn't work on an actual device with the error "The Javascript Facebook SDK must be loaded before calling init" in the Parse JS SDK.


Need Your Help

Datacenter infrastructure - Planning a high-availability infrastructure

infrastructure iscsi san

I'm new to Datacenter infrastructure and I'm solving some exercises. I came across a question that I can't answer so I'm hero to ask some help. The question is: