I'm building a webapp (later I will deploy it with Phonegap) with NodeJS at de backend and AngularJS at the front and I'm trying to use Facebook authentication. The Node server runs at localhost:3000 (later it will be at a server on the www) and the AngularJS app runs at localhost:8100. I'm using ngFacebook (https://github.com/GoDisco/ngFacebook) to handle the Facebook SDK.
To use Facebook authentication, it's ok during development to set the App Domain in Facebook to "localhost", it works fine. I can get the access token at the frontend, store it at the backend, check if it's valid, use web tokens to validate the session with Express, etc...
But I can't use app domain to a phonegap app, because it does not run at a server (I guess it runs, at the webview, as file://etc...).
Does anyone know a way to solve it? I took a look in Facebook App Settings that I can add a platform (android, iOS, paget tab?) but I don't think this is the best way. Also, at the Advanced tab there are some options that seems to be to deal with it (I can set if this is a native or desktop app, it gives to me a client token, etc...) but there's nothing at the docs saying what to really do with this.
UPDATE: I solved the problem with Eugenio's answer. I removed the ngFacebook and started to use this implementation http://blog.geniuspods.com/2013/10/15/how-to-use-facebooks-oauth-with-phonegap/ Just a note: loadstart event do not exist in window from desktop browsers (it's only for InnAppBrowser). So, during development, I used postMessage to communicate between the opener window and the popup, becaus they are at different domains.
You have to use InAppBrowser
Basically:
loadstart event listener with a callback function to trigger when the URL changescallback method