facebook / facebook-ios-sdk

Used to integrate the Facebook Platform with your iOS & tvOS apps.

Home Page:https://developers.facebook.com/docs/ios

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

SamuelZhaoY opened this issue · 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);
    }];

We have same issue here #2387