Open Krailit opened 8 years ago
@Krailit thanks but it only fixes logout-login problem. Clicking directly done button didnt work for me. I tried in my ionic project - 1- click login facebook button 2 - Inapp browser opens, but i just click done button in the bottom without filling login params. 3- login facebook button not works when i try to click again.
Did you try to chage 'loadstop' EventListener callback funtion ?
in anorther project, I must do this. Still don't know why T.T
function loginWindow_exitHandler() {
console.log('exit and remove listeners');
// Handle the situation where the user closes the login window manually before completing the login process
if (loginCallback && !loginProcessed) loginCallback({status: 'user_cancelled'});
loginWindow.removeEventListener('loadstart', loginWindow_loadStartHandler);
loginWindow.removeEventListener('loadstop', loginWindow_loadStartHandler);
loginWindow.removeEventListener('exit', loginWindow_exitHandler);
loginWindow = null;
console.log('done removing listeners');
}
if (options && options.scope) {
scope = options.scope;
}
loginCallback = callback;
loginProcessed = false;
startTime = new Date().getTime();
loginWindow = window.open(loginURL + '?client_id=' + fbAppId + '&redirect_uri=' + redirectURL +
'&response_type=token&scope=' + scope, '_blank', 'location=no,clearcache=yes');
// If the app is running in Cordova, listen to URL changes in the InAppBrowser until we get a URL with an access_token or an error
if (runningInCordova) {
loginWindow.addEventListener('loadstart', loginWindow_loadStartHandler);
loginWindow.addEventListener('loadstop', loginWindow_loadStartHandler);
loginWindow.addEventListener('exit', loginWindow_exitHandler);
}
// Note: if the app is running in the browser the loginWindow dialog will call back by invoking the
// oauthCallback() function. See oauthcallback.html for details.
Unfortunately no, but i noticed that done button only shows in emulator so actually it wont be any problem.
_## Line: 140+. Just Fix like this to open login browser again. =.= _
edit: fixed some text