Hey Steve, any chance you can post your working snippet for others?
Hey Steve, any chance you can post your working snippet for others?
Hello!
Try the following codeprevar redirectUrl = 'http://appery.io/app/view/xxxxxx-xxxx-xxxx-xxxx-xxxxxxxx/result.html';
var url = 'https://www.facebook.com/dialog/oauth?client_id=XXXXXXXXXXXX';
url += '&redirect_uri=' + redirectUrl;
url += '&scope=user_education_history,friends_education_history,user_work_history,friends_work_history';
url += '&state='+OAuth.nonce(17);
if (typeof(cordova) !== "undefined") {
var ref = window.open(url, '_blank', 'location=yes');
ref.addEventListener('loadstart', function(event) {
if(event.url.indexOf(redirectUrl) === 0) {
/* if user successfully logged in /
ref.close();
var vars = parseUrlVars(event.url);
localStorage.setItem('code', vars.code); / store secret code /
Appery.navigateTo('result', {reverse: false}); / Navigate to page 'result' */
}
});
} else {
localStorage.setItem('code', '');
window.open(url);
};/preplease note on device this code should be invoked only after device ready event.
hi, I'm experiencing the same problem. What is the library you updated to version 1.2?
I switched to the 1.2 library which resolved the issue.
yes but which library? HOw did you update it? I got lost following the thread and I'm not sure if you were talking about a PhoneGap library configurable inside Appery or about another external library.
Go to your app settings tab and choose the "external resources" option. Near the top, you can select the library version.
Thanks a lot Steve, It worked like a treat!