React-native-fbsdk: unable to Login with different user in android/iOS

Created on 29 May 2019  路  25Comments  路  Source: facebook/react-native-fbsdk

馃悰 Bug Report


If i login to fb using id say [email protected], then i logout . when i click login i can see only "continue" button. i don't see username and password prompt in webview. I cannot find a way to login with other user id say [email protected]

To Reproduce

  • Login with a user
  • logout
  • again try to login
  • unable to enter another user id and password

Expected Behavior


Should be able to login with different user on logout.

Code Example

Environment


Environment:
OS: Windows 10
Node: 8.10.0
Yarn: 1.15.2
npm: 5.6.0
Watchman: Not Found
Xcode: N/A
Android Studio: Version 3.1.0.0 AI-173.4819257

Packages: (wanted => installed)
react: 16.3.1 => 16.3.1
react-native: 0.55.4 => 0.55.4

Most helpful comment

using LoginManager.logOut(); to completely logout facebook in browser.

All 25 comments

You must log out through facebook website

I checked my browser . the account is not logged in the browser. but when i go through app it asks for continue.

I'm having the same problem in the version 0.10.0, the loginBehavior ('web') support was removed and we added some support for 'browser' in IOS, as we would have to login to different accounts

Same problem here.

Any updates?

Same problem here

Any updates?

Any updates?

any solution?

same problem, no solution?

using LoginManager.logOut(); to completely logout facebook in browser.

@quocdai92 , I do not think its helping
before everytime calling facebook login I am trying LoginManager.logOut(); , at android phone Modal is not popping up to ask different user , but just login in no time.

@quocdai92 I have found if I logout into facebook app only then popup appears in my app to choose one of facebook account .

Any updates?

any updates?

Anyone found any solution to this problem?

This is very annoying. Has anyone found a way to solve this?

Hello, still looking for an answer here, i'm having this issue where when i connect one account, i can't log in into another one with facebook. I already uninstalled facebook app, logged out from browser but still it uses the same account, looking for help please

any updates ?

any updates ?

sadly not

why is still no update ???

Anyone found any solution to this problem?

async logout() {
try {
this.setState({isLoading: true})
let tokenObj = await AccessToken.getCurrentAccessToken();
if(tokenObj){
let current_access_token = tokenObj.accessToken.toString();
let logout = new GraphRequest(
'me/permissions/',
{
accessToken: current_access_token,
httpMethod: 'DELETE',
},
(error, result) => {
if (error) {
console.log('Error fetching data: ' + error.toString());
} else {
LoginManager.logOut();
console.log('deleted**');
this.completeFurtherLogout();
}
},
);
new GraphRequestManager().addRequest(logout).start();
}else{
this.setState({isLoading: true});
await this.completeFurtherLogout();
}
} catch (err) {
console.log(err);
this.setState({isLoading: false});
}
}

This will logout the user from your app, but in case u r still logged in from facebook app or web you will need to logout from there first.

@mohity777
Can you suggest any alternative? It is still using the same account.
I am trying with one of the test users so they are not logged in anywhere else, don't even have the Facebook app on the emulator but still stuck

This is the only method i know that should log the user out from app. If u dont have facebook app installed then it must be opening webview. Try to logout from the webview.

Was this page helpful?
0 / 5 - 0 ratings