0
votes

My Visual studio 2015 Cordova app, which uses facebook login is working fine in Ripple emulator. However, when I try to run the same app in Android emulator or in device, I get the error: “Given URL is not allowed by the Application configuration: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains.".

In my facebook settings (https://developers.facebook.com) for website I have following entry:

Site URL: http://localhost:4400/ Mobile Site URL: http://localhost:4400/

In Advanced Tab, OAuth settings, both Client OAuth Login and Embedded browser OAuth Login are “yes”. I tried with “Valid OAuth redirect URIs” keeping empty or http://localhost:4400/login

Hosts file does have an 127.0.0.1 localhost entry.

What should be the right URL in Site URL for an application in Basic and Advanced tab of http://developers.facebook.com? Wondering if these fields are ignored for a mobile app?

1
Have you tried the one mentioned here developers.facebook.com/docs/facebook-login/… for desktop apps? - CBroe

1 Answers

1
votes

Like on a device, when running in the Android emulator, the Android OS believes "localhost" is the device itself rather than your PC. This is just like running Windows in a VM in this regard. Try fully qualifying your machine name or using an external IP instead.