CrossGeeks / FacebookClientPlugin

Facebook Client Plugin for Xamarin iOS and Android
MIT License
106 stars 32 forks source link

The cached account on the Facebook login page #59

Closed VlasiukVV closed 4 years ago

VlasiukVV commented 4 years ago

Hi everyone, I have a problem with login and log out from Facebook on iOS platform. The first time when I call the login method for Facebook, show the page with login and password for login. Then when I log out from the app I call the method to log out from Facebook too. Next time I want to login to the app, I call the method to login from Facebook, but my account is cache on the login page, and I can't change it. Maybe somebody knows how clear the account from the Facebook login page.

Bug Information

Version Number of Plugin: 2.1.14 Device Tested On: iPhone X Simulator Tested On: iPhone 11 Pro and 8 Version of VS: 8.3.7

Steps to reproduce the Behavior

1) You need to use the login method: CrossFacebookClient.Current.RequestUserDataAsync(...) 2) When I log out from the app I call the method: CrossFacebookClient.Current.Logout().

Expected Behavior

When I call the method to logout from Facebook, my account will be removed from the Facebook login page.

Actual Behavior

When I call the method to logout from Facebook, my account still cached on the Facebook login page.

Code snippet

Log in: _facebookService = CrossFacebookClient.Current; try {

            if (_facebookService.IsLoggedIn)
            {
                _facebookService.Logout();
            }

            InvokeOnMainThread(async () => { EventHandler<FBEventArgs<string>> userDataDelegate = null;
            userDataDelegate = async (object sender, FBEventArgs<string> e) =>
            {
                switch (e.Status)
                {
                    case FacebookActionStatus.Completed:
                        //To Do....
                        break; 
                    case FacebookActionStatus.Canceled:
                        break;
                }
                _facebookService.OnUserData -= userDataDelegate;
            };

            _facebookService.OnUserData += userDataDelegate;
            _facebookService.OnLogin += _facebookService_OnLogin;
            string[] fbRequestFields = { "email", "first_name", "gender", "last_name", "birthday" };
            string[] fbPermisions = { "email", "public_profile" };
            await _facebookService.RequestUserDataAsync(fbRequestFields, fbPermisions);

            });
        }
        catch (Exception ex)
        {
            Debug.WriteLine(ex.ToString());
        }

Log out: CrossFacebookClient.Current.Logout();

codedispenser commented 4 years ago

@VlasiukVV Was there something you did to fix this or just abandoned it? I am running into the same problem.

srdmnc commented 4 years ago

@rdelrosario @codedispenser Same problem here, it seems like that the CrossFacebookClient.Current.Logout() method is not working properly.