hello.js facebook login redirect uri not supported, app ID invalid

1k Views Asked by At

I'm building a mobile app using Intel-xdk along with hello.js (a client side javascript sdk) for facebook login because it's the only thing that makes fb login work for me on Intel.
The hello.js instructions were hard for me to figure out even though they seem simple. This is the init code as provided by the hello.js documentation. https://adodson.com/hello.js/

hello.init({
    facebook: ************,
    windows: WINDOWS_CLIENT_ID,
    google: GOOGLE_CLIENT_ID
}, {redirect_uri: 'index.html'});

I need to note that I'm testing this on the intel-xdk emulator, on my iphone, and on the chrome browser. I am getting two different errors depending on where I test. I get either "app ID invalid", or "redirect uri not supported". Is there a different way I should be writing the redirect uri.

***UPDATE**** I got rid of the "windows" and "google" properties because I'm not using either of them for login. I also swapped "google" into the redirect uri. It didn't work when I used www.google.com, but DID work when I used https://www.google.com. So I think using "https" matters. This is what this init code block looks like now:

hello.init({
            facebook: '178363645852696'
        }, {redirect_uri: "https://www.google.com"});

Here are the different errors I'm getting now. On the intel-xdk emulator it goes right to google no problem. On the device it tells me I'm not logged in ( which isn't true). On chrome the message in the pop up window says this :

Given URL is not whitelisted in Client OAuth Settings: This redirect failed because the redirect URI is not whitelisted in the app’s Client OAuth Settings. Make sure Client and Web OAuth Login are on and add all your app domains as Valid OAuth Redirect URIs.

I will continue to work on this and update my solutions, but additional solutions are wanted.

1

There are 1 best solutions below

4
On

The sdk you are using is for websites not for cordova apps.

If you have code locally and building app using intel-xdk, then using a facebook cordova plugin is best solution, here is tutorial on how to get facebook API working in intel-xdk:

https://software.intel.com/en-us/xdk/article/facebook-connect-plugin-android-ios