samedi 11 juin 2016

Facebook login do not work on some devices

My problem is the following: I notice that some users trying to login in my app fail to login. It happens to maybe 20% of them and I am not sure which phone they use. I notice the observation on iPhone and android phones.

I believe this is maybe due to one of my parameter in the facebook console, but I am not sure which one. enter image description here

enter image description here

Did anyone of you entered in that scenario before? At the moment I can see the API stat from facebook that see errors when users try to login but I do not know how to get the error information

enter image description here

At the moment it looks like those users always end up in the error case of the facebook API when logging in.

Objective C code:

if([FBSDKAccessToken currentAccessToken] != nil)
        [self loginUser];
    else{
        FBSDKLoginManager *login = [[FBSDKLoginManager alloc] init];
        login.loginBehavior = FBSDKLoginBehaviorSystemAccount;

        // THIS PART ALWAYS SWAP FROM MY APP TO FACEBOOK APP
        [login logInWithReadPermissions:@[FACEBOOK_EMAIL, FACEBOOK_PUBLICPROFILE] handler:^(FBSDKLoginManagerLoginResult *result, NSError *error) {
                if (error){
                    [login logOut];
                }
                else if ([result isCancelled] == YES){
                    [login logOut];
                }
                else{
                    [self loginUser];
                }
            }];

    }

Android code:

            FacebookSdk.sdkInitialize(getApplicationContext());
            LoginManager loginManager = LoginManager.getInstance();
            callbackManager = CallbackManager.Factory.create();

            // Register the callback manager to the facebook login manager
            loginManager.registerCallback(callbackManager, new FacebookCallback<LoginResult>() {
                @Override
                // If the callback is sucessfull then we log the user in
                public void onSuccess(LoginResult loginResult) {
                    logUserIntoApp();
                }

                @Override
                // If the callback specify that the user cancel the facebook login
                public void onCancel() {
                    Mint.logExceptionMessage("onCancelFacebookLogin", null, new Exception("onCancelFacebookLogin"));
                    setFinResult(CANCEL);
                }

                @Override
                // If there was an error, we specify that there was an error during the facebook login
                public void onError(FacebookException exception){
                    Mint.logExceptionMessage("onErrorFacebookLogin", null, new Exception("onErrorFacebookLogin"));
                    setFinResult(FAIL);
                }
            });
            // First check if the user is already logged in, and if he is then logged in automatically in TMO
            if (isLogedIn()) logUserIntoApp();
                // Otherwise login the user with the required permissions
            else loginManager.logInWithReadPermissions(this, Arrays.asList("email", "user_photos", "user_birthday", "public_profile"));

Here are the store links too: https://play.google.com/store/apps/details?id=pro.appus.takemeout https://itunes.apple.com/gb/app/tmo-dating/id1032349052?mt=8

Any help on this would be very appreciated. thanks

Aucun commentaire:

Enregistrer un commentaire