Using facebook SDK on Android gives “User logged in as different Facebook user.” error

后端 未结 5 1027
Happy的楠姐
Happy的楠姐 2021-01-31 15:02

I\'m upgrading my use of the Facebook SDK to the latest version. The following code is prety much lifted line by line from Facebook\'s own examples, which can be found here: htt

5条回答
  •  既然无缘
    2021-01-31 15:30

    You would get this error if you already have a valid access token, but are requesting additional permissions (via the LoginManager.logInWithReadPermissions call), and the user logged into the FB app is different from the one you already have an access token for. You can do a couple of things:

    1. Check that you already have a valid access token (AccessToken.getCurrentAccessToken() != null), and don't request more permissions.
    2. If you do need to request more permissions, and you get this error, ask the user to log out of the FB app, and log in as themselves.

提交回复
热议问题