Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS V 17.0.0 Some users cannot log in #2426

Open
5 tasks done
18339689882 opened this issue May 21, 2024 · 4 comments
Open
5 tasks done

iOS V 17.0.0 Some users cannot log in #2426

18339689882 opened this issue May 21, 2024 · 4 comments

Comments

@18339689882
Copy link

Checklist before submitting a bug report

Xcode version

15.0

Facebook iOS SDK version

17.0.0

Dependency Manager

CocoaPods

SDK Framework

Login

Goals

Hello Facebook Developers,

After updating to iOS SDK 17.0.0, we have received feedback from our users that they are unable to log in using Facebook. Our current implementation code is as follows:

FBSDKLoginManager *manager = FBSDKLoginManager.new;

NSMutableArray *permissions = @[@"public_profile",
@"email"].mutableCopy;
if (enable) {
[permissions addObject:@"user_friends"];
}

[manager logInWithPermissions:permissions fromViewController:UIApplication.CPS_rootViewController handler:^(FBSDKLoginManagerLoginResult *r, NSError *e) {
CPSSocialResult *result = [[CPSSocialResult alloc] init];

if (r.token) {
    NSString *fields = [NSString stringWithFormat:@"id,name,picture.width(%.0f).height(%.0f)", size.width, size.height];
    NSDictionary *params = @{@"fields" : fields};
    
    FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc] initWithGraphPath:@"me" parameters:params];
    
    [request startWithCompletion:^(id<FBSDKGraphRequestConnecting>  _Nullable connection, id  _Nullable r, NSError * _Nullable e) {
        CPSSocialUser *su = CPSSocialUser.new;
        su.type = CPSSocialTypeFB;
        su.openId = FBSDKAccessToken.currentAccessToken.userID;
        su.token = FBSDKAccessToken.currentAccessToken.tokenString;
       // Use userID and tokenString to interact with the server
    }];
}

}
I have noticed that the developer documentation mentions Limited Login. I have a few questions:

In what situations should I use Limited Login (FBSDKLoginTrackingLimited), and in what situations should I use Regular Login (FBSDKLoginTrackingEnabled)?
In Limited Login mode, we obtain FBSDKProfile.currentProfile.userID and FBSDKAuthenticationToken.currentAuthenticationToken.tokenString. How should we perform the token validation process, and how does it differ from the previous validation process?
I urgently need your help to resolve the issue of users being unable to log in. Thank you!

Expected results

to log in

Actual results

login Faild

Steps to reproduce

No response

Code samples & details

FBSDKLoginManager *manager = FBSDKLoginManager.new;
    
NSMutableArray *permissions = @[@"public_profile",
                                @"email"].mutableCopy;
if (enable) {
    [permissions addObject:@"user_friends"];
}

[manager logInWithPermissions:permissions fromViewController:UIApplication.CPS_rootViewController handler:^(FBSDKLoginManagerLoginResult *r, NSError *e) {
    CPSSocialResult *result = [[CPSSocialResult alloc] init];
    
    if (r.token) {
        NSString *fields = [NSString stringWithFormat:@"id,name,picture.width(%.0f).height(%.0f)", size.width, size.height];
        NSDictionary *params = @{@"fields" : fields};
        
        FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc] initWithGraphPath:@"me" parameters:params];
        
        [request startWithCompletion:^(id<FBSDKGraphRequestConnecting>  _Nullable connection, id  _Nullable r, NSError * _Nullable e) {
            CPSSocialUser *su = CPSSocialUser.new;
            su.type = CPSSocialTypeFB;
            su.openId = FBSDKAccessToken.currentAccessToken.userID;
            su.token = FBSDKAccessToken.currentAccessToken.tokenString;
           // Use userID and tokenString to interact with the server
        }];
    }
}
@yanjincheng
Copy link

same question

@phongth7
Copy link

phongth7 commented Jun 4, 2024

I was in a similar situation recently.
To summarize, a limited login is required if opting out of the AT.
For more #2365

@kobe1941
Copy link

kobe1941 commented Jun 7, 2024

try ios 17.0.2 version and use xcode 15.4

@ColtonIdle
Copy link

@phongth7 how do I opt into ATT?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants