facebook-ios-sdk icon indicating copy to clipboard operation
facebook-ios-sdk copied to clipboard

After FBSDK 17.0.0, `[FBSDKLoginManager logInFromViewController]` always return login flow canceled

Open SamuelZhaoY opened this issue 1 year ago • 4 comments

Checklist before submitting a bug report

Xcode version

14.1

Facebook iOS SDK version

Tried both 17.0.0 / 17.0.1

Dependency Manager

CocoaPods

SDK Framework

Login, strictly following FBLoginSDK official guide to configure the project~

Goals

Our company have more than 10 FB Application, after migrating to iOS FBSDK 17.0.0. We found that when using one of the Facebook AppID and ClientToken, the following method always return result with isCancelled = true.

- (void)logInFromViewController:(UIViewController * _Nullable)viewController 
                                configuration:(FBSDKLoginConfiguration * _Nullable)configuration 
                                    completion:(FBSDKLoginManagerLoginResultBlock _Nonnull)completion;

What makes our team confused is that:

  • Previously when using the 16.2.1 version of the SDK, the FB App configuration is working fine. Now the issue happens for both 17.0.0 and 17.0.1
  • The rest of the FB App configurations (around 10) is working fine, yet the single FB App has such issue 🤔️
  • For the same xcode workspace, as soon as we change the FacebookClientToken/FacebookAppID and the URL in the app's info.plist , things can work as expected.

Not sure it is a bug in the Facebook Login SDK or any potential misconfiguration on the Facebook Developer console

Expected results

We are expecting after upgrading SDK to 17.0.0 and above, with the previous FB App configuration, the login should not be blocked

Actual results

isCanceled is always set to true, seems the login flow is canceled by FBSDK

Steps to reproduce

Not sure whether any people met similar issues~

Code samples & details

FBSDKLoginManager *login = [[FBSDKLoginManager alloc] init];
    FBSDKLoginConfiguration *configuration = [[FBSDKLoginConfiguration alloc]
                                              initWithPermissions:@[@"public_profile", @"email"]
                                              tracking:FBSDKLoginTrackingLimited];
    [login logInFromViewController:[UITool getCurrentVC]
                     configuration:configuration
                        completion:^(FBSDKLoginManagerLoginResult * _Nullable result, NSError * _Nullable error) {
        if (error) {
            // error
        } else if (result.isCancelled) {
            //
            // this is the code always goes to under one
            // of the specific fb app configuration
            // 
        } else {
            // success, which should be expected
        }
        callback(responseDic);
    }];

SamuelZhaoY avatar May 04 '24 10:05 SamuelZhaoY

We have same issue here https://github.com/facebook/facebook-ios-sdk/issues/2387

fgeracitano avatar May 04 '24 11:05 fgeracitano

It may be a problem with FB parameters, such as whether the package name, FacebookAppID, and FacebookClientToken match, check it

ahcfhy avatar May 13 '24 09:05 ahcfhy

I have the same issue, and I have three application in my developer team with same code, there are two application can login, one always return cancelled.

xsgoing avatar May 14 '24 11:05 xsgoing

I am encountering an error while using FBSDKLoginManager. I also couldn't find the class in loginkit. Please help how to solve this.

Screenshot 2024-06-20 at 12 32 30 PM

nickqlx avatar Jun 20 '24 07:06 nickqlx