Open GoogleCodeExporter opened 8 years ago
Note that this "App Login" webpage is what shows up after you enter your email
address and password for the very first time. This is where you are
authorizing the app for whatever permissions it is requesting.
Original comment by jamie...@insightbb.com
on 29 Nov 2011 at 12:29
I dug a little more into this. The problem is that both the result and fail
objects are null when passed to FacebookMobile.handleLogin(result:Object,
fail:Object)
The fail object should not be null in this case. It is null, because of line
#146 in MobileLoginWindow.handleLocationChange()
loginCallback(null, FacebookDataUtils.getURLVariables(location).error_reason);
The FacebookDataUtils.getURLVariables() method is being sent the following URL,
which causes a problem:
http://www.facebook.com/connect/login_success.html?error_reason=user_denied&erro
r=access_denied&error_description=The+user+denied+your+request.#_=_
FacebookDataUtils.getURLVariables() returns an instance of URLVariables with
just one property (see attached image).
The way I fixed it was to reverse the order of the if else statement in
FacebookDataUtils.getURLVariables
Changed this:
if (url.indexOf('#') != -1) {
params = url.slice(url.indexOf('#')+1);
} else if (url.indexOf('?') != -1) {
params = url.slice(url.indexOf('?')+1);
}
To this:
if (url.indexOf('?') != -1)
params = url.slice(url.indexOf('?') + 1);
else if (url.indexOf('#') != -1)
params = url.slice(url.indexOf('#') + 1);
That avoids the run time error and the method now returns a correct
URLVariables instance (see attached image). There may be a better fix, however.
One thing that is still an issue, though, is that when the user clicks that
Cancel button, they can never get back to the first login screen where it asks
for the email address and password. Even if you call logout(). And sometimes
it even shows the Facebook home page http://www.facebook.com/home.php
To get back to the original login screen, they have to click the "Log In"
button and authorize the app. Then they can successfully logout.
Original comment by jamie...@insightbb.com
on 29 Nov 2011 at 5:03
Attachments:
someone compile the patched version? i have the same problem :(
Original comment by magc...@gmail.com
on 21 Mar 2012 at 7:37
Here is the compiled swc with the fix I posted in comment #1.
Original comment by jamie...@insightbb.com
on 21 Mar 2012 at 8:48
Attachments:
Thanks, I was getting the same error on "cancel", but you are correct,
sometimes after cancel it does hang or redirects to another facebook page.
Have you seen or heard any updates?
Original comment by lbar...@thesminc.com
on 26 Mar 2012 at 5:56
I get this url returned "http://m.facebook.com/home.php?refid=0&_rdr" .
handleLocationChange in MobileLoginWindow.as checks url's established in
FacebookURLDefaults.as. By adding that url in FacebookURLDefaults.as or check
for it in handleLocationChange., it seemed to allow multiple cancels and allows
you to properly login
Original comment by lbar...@thesminc.com
on 26 Mar 2012 at 9:59
Original issue reported on code.google.com by
jamie...@insightbb.com
on 28 Nov 2011 at 11:33Attachments: