openGeeksLab / codenameone

Automatically exported from code.google.com/p/codenameone
0 stars 0 forks source link

IOS - Facebook login work every only every other attempt #1288

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
It seems that consecutive Facebook login work every only every other attempt.
- if the user signs in with Facebook from the first screen everything works 
fine: he is redirected to the main screen of the app and in the My Account 
section from the menu he can see his Facebook credentials (user name and 
profile picture) and the log out button.

- the user can choose to log out from Facebook by clicking the "Log out" 
button. Once this happens, the view is refreshed and the "sign in with 
Facebook" button is shown instead of the "Log out" button. If he chooses to log 
in again with Facebook, the log in fails. I can't see any error messages. The 
user is just left in the same screen. Only, when he clicks "sign in with 
Facebook" button for the third time he is actually logged in and the screen is 
refreshed showing him the Facebook credentials.

This behavior is repetitive, meaning the log in always works the first time, 
the third time, the fifth time etc but it always fails the second time, the 
fourth time, the sixth time etc.

Facebook log in is done like this:

FacebookConnect connect = FacebookConnect.getInstance();

if (connect.isFacebookSDKSupported()) {
connect.setCallback(new LoginCallback() {

@Override
public void loginFailed(String errorMessage) {
Log.p("Login failed: " + errorMessage);

}

@Override
public void loginSuccessful() {
Log.p("Success");
}
});
connect.login();

Please note that when the login fails the error message from loginFailed() is 
blank.

This problem only appears on IOS. On Android the same code works as expected.

Tested on iPad Air with IOS version 8.0.2.

Original issue reported on code.google.com by pascules...@gmail.com on 15 Jan 2015 at 8:41