facebook / facebook-ios-sdk

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

The app does not return to the previous state after logging in on the Facebook app login screen. #2304

Open phillip5094 opened 9 months ago

phillip5094 commented 9 months ago

Checklist before submitting a bug report

Xcode version

14.3

Facebook iOS SDK version

14.1.0

Dependency Manager

CocoaPods

SDK Framework

Login

Goals

Upon logging in to the Facebook app, it should return to the previous app, and the successful login callback must be invoked.

Expected results

Upon logging in to the Facebook app, it should return to the previous app, and the successful login callback must be invoked.

Actual results

When I invoked the login API of the Facebook iOS SDK, the transition to the Facebook app worked correctly. However, after logging in by selecting a profile in the Facebook app, although the Facebook app itself logged in, it did not return to the previous app, and the callback was not triggered.

RPReplay_Final1700716527

Steps to reproduce

1) Prepare the Facebook app without an active login. (If already logged in, log out.) 2) Call the loginManager.logIn API with LoginConfiguration.tracking set to .enabled. 3) Transition to the Facebook app, and select the profile image within the Facebook app. 4) While the login is successful within the Facebook app, there is no transition back to the app that invoked the loginManager.logIn API, and the callback is not triggered.

Code samples & details

@IBAction func invokeLoginMethod() {
    loginManager.logIn(
        viewController: self,
        configuration: .init(permissions: [.publicProfile, .email], tracking: .enabled)
    ) { [unowned self] result in
        switch result {
        case .cancelled:
            self.presentAlert(
                title: "Cancelled",
                message: "Login attempt was cancelled"
            )
        case .failed(let error):
            self.presentAlert(for: error)
        case .success:
            self.updateLoginButton()
            self.showLoginDetails()
        }
    }
}
fuwenhuai commented 6 months ago

I also encountered this problem. Have you resolved it?

aemreb commented 3 months ago

I am struggling with this as well. Any updates? I think I will route all logins through Limited Login if this issue persists.

JefriReynaldi commented 3 months ago

@IBAction func invokeLoginMethod() { loginManager.logIn( viewController: self, configuration: .init(permissions: [.publicProfile, .email], tracking: .enabled) ) { [unowned self] result in switch result { case .cancelled: self.presentAlert( title: "Cancelled", message: "Login attempt was cancelled" ) case .failed(let error): self.presentAlert(for: error) case .success: self.updateLoginButton() self.showLoginDetails() } } }