Page 1 of 3

Facebook redirect_uri is required

Posted: Wed Sep 11, 2013 7:47 pm
by Grace Yip

hi,

some i am trying to make a facebook login with the following tutorial:
http://docs.appery.io/tutorials/build...

but get the following error when running app in browser (the parameter redirect_uri is required)

so i have registered my app with facebook developer i have filled in the redirect url (Website with FB login)

i have setup the js file (Facebook_utils) and i have the following code attachted to the login button as a click event.

var redirectUrl = 'http://appery.io/app/view/fab7f856-df...';

var url = 'https://www.facebook.com/dialog/oauth...';
url += '&redirect_uri=' + redirectUrl;
url += '&scope=user_education_history,friends_education_history,user_work_history,friends_work_history';
url += '&state='+OAuth.nonce(17);

var cb = null;
if(window.plugins) {
cb = window.plugins.childBrowser;
}
if (cb != null) {
/* Wen native childBrowser plugin must be used to navigate to facebook. /
cb.onLocationChange = function (url) {
if(url.indexOf(redirectUrl) === 0) {
/ if user successfully logged in /
cb.close();
var vars = parseUrlVars(url);
localStorage.setItem('code', vars.code); / store secret code /
Appery.navigateTo('result', {reverse: false}); / Navigate to page 'result' */
}
};

Code: Select all

cb.showWebPage(url); 

}
else {
localStorage.setItem('code', '');
window.open(url);
};

can someone tell me why i get the error parameter redirect_uri is required ?


Facebook redirect_uri is required

Posted: Wed Sep 11, 2013 9:21 pm
by Alena Prykhodko

Hello!

Please check browser console if there are errors, send us screen shots.
Make sure you didn't miss something in tutorial.


Facebook redirect_uri is required

Posted: Thu Sep 12, 2013 6:36 pm
by Grace Yip

Image

i dont understand why i get an error when i only copy pasted the code from the tutorial


Facebook redirect_uri is required

Posted: Thu Sep 12, 2013 9:05 pm
by Kateryna Grynko

Hi,

We are sorry, there is an error in our documentation.
Please replace:
codeif(params.indexOf('#')>=0) {/codewith the following:
codeif(params.indexOf('#')>=0) {/code


Facebook redirect_uri is required

Posted: Thu Sep 12, 2013 9:30 pm
by Grace Yip

hi,

i replace the code as you suggested but i still get the error. thought this time when i check it with the error console in firefox i get no error message....


Facebook redirect_uri is required

Posted: Fri Sep 13, 2013 10:59 am
by Maryna Brodina

Hello! Sorry for late reply. Did you get the same error? Did you get that error when you were trying to connect to Facebook or get data?


Facebook redirect_uri is required

Posted: Fri Sep 13, 2013 2:32 pm
by Grace Yip

Hi

I get the same error when trying to connect (login with FB)....


Facebook redirect_uri is required

Posted: Fri Sep 13, 2013 2:33 pm
by Grace Yip

Hi

I get the same error when trying to connect (login with FB)....


Facebook redirect_uri is required

Posted: Fri Sep 13, 2013 4:34 pm
by Kateryna Grynko

Could you please share the app with a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a?


Facebook redirect_uri is required

Posted: Fri Sep 13, 2013 8:35 pm
by Grace Yip

ok i shared the project