Home > Software engineering >  Flutter: log in with a different Facebook user
Flutter: log in with a different Facebook user

Time:12-17

Using https://pub.dev/packages/flutter_facebook_auth flutter_facebook_auth: ^3.5.7

When I log out I run await FacebookAuth.instance.logOut(); but despite of that, the user is always saved and I just have to click continue.

Log in works fine with final LoginResult result = await FacebookAuth.instance.login();

CodePudding user response:

From their documentation, this is how you are supposed to do a clean logout.

Future<void> _logOut() async {
    await FacebookAuth.instance.logOut();
    _accessToken = null;
    _userData = null;
    setState(() {});
  }

Make sure you set _accessToken and _userData to null

CodePudding user response:

Not possible due to Facebook's policy:

https://developers.facebook.com/docs/facebook-login/reauthentication/ "The Android and iOS SDKs don't currently support re-authentication."

  • Related