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

Unable to get token_for_business in case user opts out of ATT

taozhang159 opened this issue · comments

Checklist before submitting a bug report

Xcode version

15.3

Facebook iOS SDK version

17.0.1

Dependency Manager

CocoaPods

SDK Framework

Login

Goals

Using Facebook that limit login, when I reject the ATT pop-up window for ad tracking, I hope to get the token_for_business corresponding to the user.

Expected results

Using Facebook that limit login, when I reject the ATT pop-up window for ad tracking, I hope to get the token_for_business corresponding to the user.

Actual results

Version:

Upgrade Facebook version to 17.0.1

Scenes:

  1. Traditional login mode,

1.1 Start the application, select the Deny Authorization ATT pop-up window, click Facebook to log in, you will enter the limited.facebook.com website, obtain the accessToken, and then request https://graph.facebook.com/v19.0/xx?access_token=xx&fields =token_for_business

{
"error": {
"message": "Invalid OAuth access token - Cannot parse access token",
"type": "OAuthException",
"code": 190,
"fbtrace_id": "A3YYkEZkifmBsHd3qLtZ9ER"
}
}

  1. Restrict login mode

2.1 Start the application, select the Deny Authorization ATT pop-up window, click Facebook to log in, you will enter the limited.facebook.com website, and the accessToken obtained is nil. Another OIDC-Token has a value, but token_for_business cannot be obtained through OIDC.

in conclusion:

I want to know how to correctly obtain token_for_business after rejecting the ATT pop-up window.

Steps to reproduce

No response

Code samples & details

// Traditional login code

[self.fbloginMangager logInWithPermissions: [self getFacebookPermissions] fromViewController:nil handler:^(FBSDKLoginManagerLoginResult *result, NSError *error) {
    if (error) {

    }else if (result.isCancelled) {

    }else {
        NSString *accessToken = result.token.tokenString? : @"";
    }
 }];



// limit login code

FBSDKLoginConfiguration *configuration =
  [[FBSDKLoginConfiguration alloc] initWithPermissions:@[@"public_profile"]
                                              tracking:FBSDKLoginTrackingLimited
                                                 nonce:@"123"];
[self.fbloginMangager logInFromViewController:nil configuration:configuration completion:^(FBSDKLoginManagerLoginResult * _Nullable result, NSError * _Nullable error) {
    if (error) {

    }else if (result.isCancelled) {

    }else {
        NSString *accessToken = result.token.tokenString;
        NSString *jwtToken =
        FBSDKAuthenticationToken.currentAuthenticationToken.tokenString? : @""
    }
}];

Face the same issue, anyone has any idea?
In the limit login, how can we get the token_for_business, since we use this field as a unique identifier for the user regist from Facebook.

Same here.
Does anyone know if it's still possible to obtain the token_for_business in this situation?