facebook / facebook-ios-sdk

Used to integrate the Facebook Platform with your iOS & tvOS apps.
https://developers.facebook.com/docs/ios
Other
7.73k stars 3.51k forks source link

Can't login with another account after logout #1147

Closed Jaylin0920 closed 4 years ago

Jaylin0920 commented 4 years ago

when I logout,I use

let loginManager = LoginManager()
loginManager.logOut()

when I login, I use

 let loginManager = LoginManager()
loginManager.logIn(permissions: [.userBirthday, .userGender, .userHometown, .userLocation], viewController: frVc) { result in
}

when I login,i want to use phone/email and password to change another account, but there show last stored user information everytime,how can i change another account???

If I manually clear the data, Setting->Safari->Advanced->Website Data -> facebook.com,slide left to delete it,it works and i can use phone/email and password to change another account,why sdk ''loginManager.logOut()" does't works,how can i change another account???

Jaylin0920 commented 4 years ago

sdk version, pod 'FacebookLogin', '0.9.0'

robtimp commented 4 years ago

Unfortunately, that works as intended and there's currently no way to switch accounts within the login dialog once a user has logged in.

I've brought up the need for better multi-user support for Facebook Login and it's on our roadmap. I'll let the team know that developers are requesting it.

ay8s commented 4 years ago

@robtimp +1 for that. Thanks! 👍

aleksiosdev commented 4 years ago

+1 for that, really need this feature

sparseware commented 4 years ago

Aside from the multi-user support issue, it is also a security and privacy issue as the user is never really logged out (no credentials required to log back in)

kevin-js commented 4 years ago

+1, it would be great if the caching behavior can be specified through a flag in the login call like

let fbLoginManager = LoginManager()
fbLoginManager.logIn(permissions: [.email, .userBirthday], viewController: self, retainSessionOnLogout: false) { result in
...
}

Trying to toggle between accounts has been a major pain point in testing so any updates on the feature roadmap for multi-user support would be much appreciated.

Edit: Thinking further on the above example it might be better to specify the login retention policy in the logout call to transition existing user sessions more seamlessly, that way the end user would be able to toggle accounts the first time they log out instead of logging out/logging back in/logging out again to apply the changes.

twototwoto commented 4 years ago

+1 for that. Thanks! 👍

rvsood commented 4 years ago

Does anyone have any workaround that they have been using in the meantime? I see in the section on reauthentication on developers.facebook.com where it says apps should create their own methods for switching between Facebook user accounts, but solutions posted on, e.g., StackOverflow are 5+ years old and don't seem to work anymore, and questions on this problem are going unanswered in the Facebook developer community forums.

joesus commented 4 years ago

sdk version, pod 'FacebookLogin', '0.9.0'

Side note: this pod refers to the deprecated facebook-swift-sdk. You almost certainly want to be using the equivalent code in this repository.

For versions below 7.0 please use:

pod 'FBSDKLoginKit/Swift'
pod 'FBSDKCoreKit/Swift'

For versions 7.0 and above please use:

pod 'FBSDKLoginKit'
pod 'FBSDKCoreKit'

Thanks!

boygiandi commented 4 years ago

I have the same problem. I login with this Facebook Account, and now, I can't change it. I did logout, clear Safari web data, remove app and re-install. When I tap Login with Facebook, I still see my Facebook Account and no button to change to another one. Where did Facebook store that account ?

Faydee1220 commented 4 years ago

I found out how to log out finally... We have to go to facebook website and login the account you want to log out, then go to Settings -> Security and Login -> Where You're Logged In, and choose the device you want to log out. image

sergeymild commented 3 years ago

can't switch account after logout, previously it works after logout in safari, but now even in safari i can't logout either

matis-schotte commented 2 years ago

I think the support regarding this issue from Facebook is surprisingly bad. "they will put it on the roadmap" and then they close this issue, not really helping at all, like at least telling us on how to achieve the logout.

I did the same as boygiandi (reset everything), still no success. It takes hours to find a way to achieve this, and I am sure other developers also have the need to use different test users. I didnt see anything in the docs on how to reset the stored credentials. Something might be stored in the keychain? Thanks to Faydee1220 now I know I can reset that login from that page. Thanks NOT to facebook for their bad support here.

kientux commented 2 years ago

Why is this closed? This is really frustating when users want to use different facebook account. Even for developers, when I want to test with other facebook account, the only way is to reset the simulator.

renanvs commented 2 years ago

when facebook will implement a real logout that you can use another profile?

mcfboss commented 2 years ago

still nothing?? the issue still there in 2022

dmytriigolovanov commented 2 years ago

As of April 13, 2022, the issue is current for SDK version 13.1. This is inadequate behaviour for such functionality, our customers are not able to use other accounts after the first login via Facebook.

Need to re-open the issue and add this in the nearest release.

Charlottenpl commented 1 year ago

666,amazing😲

DennisAshford commented 1 year ago

Just to make sure I understand this correctly. Once I am logged into an account on iOS, I cannot logout and log into another Facebook account? I am running into an issue testing 'Login With Facebook' flows because I cannot test it on multiple accounts. And now Facebook is not allowing developers to make new test accounts either. So how are we supposed to test new login flows and other features if we cannot test it on multiple accounts?!

Taymindis commented 1 year ago

Just uninstall and resintall the app?

KovtunOleg commented 7 months ago

Hi Guys, it is already autumn 2023 and still we can't switch between multiple accounts, can you please prioritize this issue, as so many people really need this feature in their apps.

gruj1995 commented 2 months ago

It's already spring 2024, and currently, it's still not possible to switch between multiple accounts. Please prioritize rolling out this feature as soon as possible!