Facebook redirect_uri is required
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 ?